[PHP] one problem in php ext development

2012-02-20 Thread Rui Hu
hi,

I want to development an extension which can do something by using HTTP
request header.  So how can php extension get those HTTP request headers?

Thanks!

Best regards,

Rui Hu

State Key Laboratory of Networking  Switching Technology
Beijing University of Posts and Telecommunications(BUPT)
MSN: tchrb...@gmail.com
-


[PHP] Re: problems in extension development

2012-02-17 Thread Rui Hu
Besides, are there some APIs I can use if I want to setget environment
variables like DOCUMENT_ROOT in my extension(similar to
sapi_cgienv_get/set).

Thanks!

2012/2/17 Rui Hu tchrb...@gmail.com

 hi,

 I just started to write a simple PHP extension hello, but encountered
 some problems. I followed tutorials step by step:
 1. ./ext_skel --extname=hello
 2. modified hello.c and php_hello.h, and wrote function hello_world()
 which simply return a string hello world.
 3. phpize
 4. ./configure ; make ;
 5. the I encountered error in make. I looked up in Makefile and found that
 $(PHP_MODULE) is null, which I think is the reason. Makefile is
 automatically generated by ./configure.

 What mistake did I make? How to fix it?

 Thanks!
 Vic Hu


 --
 Best regards,

 Rui Hu

 
 State Key Laboratory of Networking  Switching Technology
 Beijing University of Posts and Telecommunications(BUPT)
 MSN: tchrb...@gmail.com

 -





-- 
Best regards,

Rui Hu

State Key Laboratory of Networking  Switching Technology
Beijing University of Posts and Telecommunications(BUPT)
MSN: tchrb...@gmail.com
-


[PHP] problems in extension development

2012-02-16 Thread Rui Hu
hi,

I just started to write a simple PHP extension hello, but encountered
some problems. I followed tutorials step by step:
1. ./ext_skel --extname=hello
2. modified hello.c and php_hello.h, and wrote function hello_world() which
simply return a string hello world.
3. phpize
4. ./configure ; make ;
5. the I encountered error in make. I looked up in Makefile and found that
$(PHP_MODULE) is null, which I think is the reason. Makefile is
automatically generated by ./configure.

What mistake did I make? How to fix it?

Thanks!
Vic Hu


-- 
Best regards,

Rui Hu

State Key Laboratory of Networking  Switching Technology
Beijing University of Posts and Telecommunications(BUPT)
MSN: tchrb...@gmail.com
-


[PHP] questions about fastcgi

2011-12-19 Thread Rui Hu
hi,

I encountered a problem while configured virtual host. My experiment
environment is Apache2+fastcgi+php-cgi.

I want to implement mass virtual hosting using rewrite rules based on
apache rewrite module. That is, for a request url like:
http://1000.xyz.com/test.php, apache will translate it to a absolute file
path like: $DOCUMENT_ROOT/1000/test.php, and then get this script to
execute.

And my conf is:
*RewriteEngine On*
*RewriteCond %{HTTP_HOST} !^www.xyz.com*
*RewriteCond %{HTTP_HOST} ^([^.]+)\.xyz\.com [NC]*
*RewriteRule (.*) /%1$1 [PT]*
I use inner redirection in order not to expose this detail to users.
Besides, I succeeded when I use external redirection, namely the [R] tag
instead of [PT] tag.
When I use [PT] tag, apache cannot run expectedly. I request a url :
http://1000.xyz.com/test.php, error message pops out like: The requested
URL /1000/cgi-bin/php.fcgi/1000/test.php was not found on this server.

I don't know if this error results from fastcgi, is it the inappropriate
config in fastcgi or inevitable problem by using it?

Really appreciate your help.

Vic

-- 
Best regards,

Rui Hu

State Key Laboratory of Networking  Switching Technology
Beijing University of Posts and Telecommunications(BUPT)
MSN: tchrb...@gmail.com
-