HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Server Operation (http://www.howtoforge.com/forums/forumdisplay.php?f=5)
-   -   fastCGI and PHP just wont work! (http://www.howtoforge.com/forums/showthread.php?t=8996)

meridianblade 10th December 2006 19:43

fastCGI and PHP just wont work!
 
Hey guys, I am absolutely stressed out with this, I just cant figure it out. Im trying to get fastCGI to work on Apache/1.3.37 with php-4.4.3.

I need to run phpsuexec and eaccelerator together and for that I need to get fastCGI working on my box.

Here's what I have done so far:

I downloaded and compiled fastCGI.

Ran the following commands:
Code:

/usr/local/apache/bin/apxs -o mod_fastcgi.so -c *.c
/usr/local/apache/bin/apxs -i -a -n fastcgi mod_fastcgi.so

so my server returns and shows that fastCGI is loading:
Server Version: Apache/1.3.37 (Unix) mod_fastcgi/2.4.2 mod_gzip/1.3.26.1a mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 mod_ssl/2.8.28 OpenSSL/0.9.7a PHP-CGI/0.1b

I added the following to the bottom of my httpd.conf
Code:

<IfModule mod_fastcgi.c>
    FastCgiIpcDir /tmp/fcgi_ipc/
    AddHandler fastcgi-script .fcgi
    FastCgiSuExec /usr/local/apache/bin/suexec
</IfModule>
FastCgiConfig -maxClassProcesses 20 -maxProcesses 20 -minProcesses 1 -processSlack 1 -idle-timeout 120

then:
Code:

mkdir -p /tmp/fcgi_ipc
chmod 755 /tmp/fcgi_ipc -R

then I compiled PHP-4.4.3 with the following:
Code:

./configure --prefix=/usr --with-xml --enable-bcmath --enable-calendar --with-curl --enable-ftp --with-gd --with-jpeg-dir=/usr/local --with-png-dir=/usr --with-xpm-dir=/usr/X11R6 --enable-magic-quotes --with-mysqli --with-mysql=/usr --enable-discard-path --with-pear --enable-sockets --enable-track-vars --with-zlib --enable-force-cgi-redirect -–enable-fastcgi

make
make install

finally a service httpd restart

needless to say my server api still shows CGI and a php -v doesnt display fastCGI at all.

What am I missing guys? :-(

Thanks for your help in advance!

falko 11th December 2006 14:39

What does a phpinfo page show?
Create a PHP file like this:
PHP Code:

<?php
phpinfo
();
?>

and access it in your browser. Does it show fastcgi?

meridianblade 11th December 2006 19:09

Hey if you want you can look at here:
http://www.crgn.net/info.php

'--enable-fastcgi' is in the config.

also:
Code:

root@host [~]# php -v
PHP 4.4.3 (cli) (built: Dec  9 2006 11:13:27)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
    with eAccelerator v0.9.3, Copyright (c) 2004-2005 eAccelerator, by eAccelerator
    with Zend Extension Manager v1.0.9, Copyright (c) 2003-2006, by Zend Technologies
    with Zend Optimizer v2.6.2, Copyright (c) 1998-2006, by Zend Technologies

does not show fast cgi.

from my httpd.conf:

Code:

LoadModule fastcgi_module    libexec/mod_fastcgi.so
AddModule mod_fastcgi.c

<IfModule mod_fastcgi.c>
    FastCgiIpcDir /tmp/fcgi_ipc/
    AddHandler fastcgi-script .fcgi
    FastCgiSuExec /usr/local/apache/bin/suexec
Action application/x-httpd-php4 "/php4.fcgi"
AddType application/x-httpd-php4 .php
AddType application/x-httpd-php4 .php4
AddType application/x-httpd-php4 .php3
AddType application/x-httpd-php-source .phps
AddType application/x-httpd-php4 .phtml

</IfModule>
FastCgiConfig -maxClassProcesses 20 -maxProcesses 20 -minProcesses 1 -processSlack 1 -idle-timeout 120

Thanks!

falko 12th December 2006 14:38

Quote:

Originally Posted by meridianblade
Hey if you want you can look at here:
http://www.crgn.net/info.php

'--enable-fastcgi' is in the config.

I think this looks good. :)

misterm 12th December 2006 15:59

Hello with all

I have this error under the archlinux....

Quote:

/usr/sbin/apxs -o mod_fastcgi.so -c *.c
/usr/build-1/libtool --silent --mode=compile gcc -prefer-pic -march=i686 -O2 -pipe -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -pthread -I/usr/include/apache -I/usr/include/apr-1 -I/usr/include/apr-1 -I/usr/include -c -o *.lo *.c && touch *.slo
X*.lo
libtool: compile: libobj name `*.lo' may not contain shell special characters.
gcc: *.c: No such file or directory
gcc: no input files
apxs:Error: Command failed with rc=65536
.
MM:confused:

meridianblade 12th December 2006 16:50

Hum, I thought it would tell me that fast cgi was running with the command php -v. How can I tell if it's running or not? I just have the feeling im missing something :-(

meridianblade 12th December 2006 18:26

It's not working, I just realized that eAccelerator works with fastCGI and as a apache module only, not regular CGI, so looking down at the eAccelerator entry it says false to both.

uhg, im so lost :(

falko 13th December 2006 14:19

Maybe these links help you: http://www.maven.pl/?p=10
http://mojora.wordpress.com/2006/12/...d-fastcgi-php/
http://www.howtoforge.com/forums/showthread.php?t=4606

misterm 2nd January 2007 12:28

Hello with all

Good year 2007

Then veiled, all functions starting from the configuration, but when I decontaminate php in my file httpd.conf, is that, when I to start again apache, it me but that like error

Quote:

Syntax error on line 36 of /etc/httpd/vhosts/Vhosts_ispconfig.conf:
Invalid command 'php_admin_flag', perhaps mis-spelled or defined by a module not included in the server configuration
[root@sv1 httpd]# nano vhosts/Vhosts_ispconfig.conf
What to make?

thank you

mm:confused: ;)

falko 3rd January 2007 17:46

What's in Vhosts_ispconfig.conf?

Is the PHP module included in your Apache configuration?


All times are GMT +2. The time now is 06:40.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.