Solution: Run PHP as CGI module It will not run as an Apache module!
--without-ldap \
--without-apache \
--enable-pcntl \
--enable-sigchild \
--enable-inline-optimization \
--enable-sockets \
--enable-track-vars \
--enable-shmop \
--enable-sysvsem \
--enable-sysvshm \
--with-mysql \
--server-uid=www \
--with-port=8010 \
--server-uid=www \
--enable-module=usertrack \
--enable-module=unique_id \
--enable-module=so \
...
--activate-module=src/modules/php4/libphp4.a
http.conf:
AddType application/x-httpd-php .php AddType application/x-httpd-php .php4 AddType application/x-httpd-php .php3 AddType application/x-httpd-php-source .sphp # change /www/php.420_cgi/bin/ to your bin path (where the php interpreter is) Options ExecCGI SymLinksIfOwnerMatch AllowOverride None # change /www/php.420_cgi/bin/ to your bin path (where the php interpreter is) ScriptAlias /php/ "/www/php.420_cgi/bin/" # do not change this! Action application/x-httpd-php "/php/php"
Do not forget to _restart_ your apache!
test_fork.php:echo "This is an echo before I called the fork command\n"; $pid = pcntl_fork(); if ($pid == -1) { die("could not fork"); } else if ($pid) { echo "I am the parent, pid = ". $pid ."\n"; } else { echo "I am the child, pid = ". $pid ."\n"; } echo "This is an echo after I called the fork command\n"; ?> if you see somethink like this:
This is an echo before I called the fork commandthen it is not working.
You need to see something like this:
This is an echo before I called the fork command I am the child, pid = 0 This is an echo after I called the fork command Content-type: text/html This is an echo before I called the fork command I am the parent, pid = 3607 This is an echo after I called the fork command
keywords: php php4 linux apache 1.3.24 cgi module pcntl_fork fork multitasking skript problem fatal error
Questions, remarks or comments: Andreas Bohne