Page 1 of 1

PHP-5 fastcgi

Posted: Fri May 05, 2006 12:46 am
by rf

Following the directions README.FastCGI, I am experiencing these problems:

Having configured PHP with --enable-fastcgi it compiles OK

"You must start the PHP binary running by giving it an IP and port number to listen to on the command line eg.
./php -b"

I get an error "no such file or directory"

It also instructs to add a line to the config file in Apache:

"LoadModule fastcgi_module /usr/lib/apache/2.0/"

Trouble is I am unable to find anything but 1.3 in /usr/lib/apache and am unable to locate any file that ends in ""

putting it in anyway with /urs/local/apache2/bin/apachectl graceful - returns the expected "no such file or dir"

Question: Any suggestions?



Posted: Sat May 06, 2006 1:43 pm
by munky
you're taking it too literally

find / -name

use that when you are adding the LoadModule line to your config

if your base path is /usr/local/apache2, which is not default, so the examples given in the README aren't going to fit exactly.

Posted: Mon May 08, 2006 11:16 pm
by rf

Appreciate the suggestion.

Ctl line command "find / -name " finds nothing. I tried locate after updatedb and did not get anything.

putting it in the config file following LoadModule then doing a graceful from apachectl gives this error:

"httpd: Syntax error on line 53 of /usr/local/apache2/conf/httpd.conf: LoadModule takes two arguments, a module name and the name of a shared object file to load it from"

LoadModule fastcgi_module find / -name or
LoadModule find / -name

both give the same error message when runing apachectl as quoted above.

I do not know what to do next.


RF :)

Posted: Mon May 08, 2006 11:53 pm
by munky
try just `locate`, it's possible it has no "mod_" in front of it's name.

Posted: Tue May 09, 2006 1:02 am
by rf
tried that sans success.

TEXTDRIVE suggested:

"AddType application/x-httpd-fastphp .php
Action application/x-httpd-fastphp /php-fastcgi/php5-fcgi"

I tried that instead of the instructed "LoadModule" advice in the INSTALL instructions.

At least now I do not get any error messages when runing apachectl :D

However it does not get rid of the problem of being back where:

http://localhost/something.php or .php5 does not run - but just displays the script.

php something.php runs the script ok but not from the browser.

current configuration is now:

php -v PHP 5.1.2 (cgi) (built: May 1 2006 10:22:14)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies

P4-3200RF:/usr/src/httpd-2.2.2# ./httpd -v
Server version: Apache/2.2.2
Server built: May 3 2006 19:05:36

P4-3200RF:/usr/src/httpd-2.2.2# ./httpd -l
Compiled in modules:

Changing to php5 and apache2 was following advice from one of the forums that was the way to get of the error "update your client to conform to the server specifications for authentication" or something along those llines. It is true that that error went away but now I am back to not being able to run the php script from the browser :(

Your patience and help is appreciated. :)

It interfaces with MySQL as expected - but I do not understand why MySQL does not show up in the list of modules. I have not been able to run info() in the browser to check if that has a MySQL section. I assume it does.


Posted: Tue May 09, 2006 7:40 pm
by rf

Reading W. Jason Gilmore (Beginning PHP5 and MySQL from Novice to Professional) it advised (pg 16) that "make clean" be performed between each ./config.

This was done with both Apache and PHP and it looks like we might be closer to getting "http://localhost/info.php" to run instead of just showing the script (which it still does with info.php5) or asking a question what wants to be done with the php script.

Problem now:

Browser gives the error that it can't find the file and says:
"The requested URL /php-fastcgi/php5-fcgi/info.php was not found on this server."

Simple! :D

Just make that directory and put the file in it so it can find it!

:( I have not been able to get it to find the file yet. Tries:

add "php-fastcgi/php5-fcgi" to the document file: "/usr/local/apache2/htdocs" and to the root directory with info.php in that spot - no success.


Where else to try (yes I have tried looking at both php.ini as well as httpd.conf and could not see anything obvious - to me!) or what else to try?

:D Thanks


Posted: Thu May 11, 2006 5:36 pm
by munky
make sure that php-fastcgi isn't a script alias that's supposed to be pointing elsewhere

`locate php-fastcgi`

`grep -i scriptalias httpd.conf`

Posted: Fri May 12, 2006 12:13 am
by rf

Thanks for the advice:

locate php-fastcgi finds nothing

# grep -i scriptalias /usr/local/apache2/conf/httpd.conf returns:

# ScriptAlias: This controls which directories contain server scripts.
# ScriptAliases are essentially the same as Aliases, except that
# client. The same rules about trailing "/" apply to ScriptAlias
ScriptAlias /cgi-bin/ "/usr/local/apache2/cgi-bin/"
# "/usr/local/apache2/cgi-bin" should be changed to whatever your ScriptAliased
# To use CGI scripts outside of ScriptAliased directories:

Still thinking and trying.

Thanks much.

RF :)

Posted: Wed May 17, 2006 10:32 pm
by rf
Follow Up:

I have gotten the browser to recognize and run php file well now doing two things:

a) remove the two lines that referenced fast-cgi from httpd.conf:

"AddType application/x-httpd-fastphp .php
Action application/x-httpd-fastphp /php-fastcgi/php5-fcgi"

b) made this change in php.ini:

open_basedir = "/usr/local/apache2/htdocs" (the default php document dir)

I never did find out how to satisfy the path or change the path fast-cgi was looking for. but now the browser can access and process php files OK.