Current time: 07-02-2024, 01:02 AM Hello There, Guest! (LoginRegister)


Post Reply 
How is FastCGI supposed to work?
Author Message
MrMarv Offline
Junior Member
*

Posts: 14
Joined: Jun 2008
Reputation: 0
Post: #1
Question How is FastCGI supposed to work?
Hi Guys and Ladies,

I am currently installing Omega RC5 on my FreeBSD 7 Box.

After some changes every little here and there the installation process worked.

My Problem now is: PHP Files are not beeing parsed and output as plain text. Regarding to this I added these following lines to /usr/local/etc/apache22/Includes/00_master.conf

AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps

into to <IfModule mod_php5.c> section.

After this my php files are parsed but another Problem came out of the sudden.

Browsing to index.php outputs:
"Warning: session_start() [function.session-start]: open(/usr/local/www/ispcp/gui/phptmp//sess_399c18f14a6c8107b1a5938feeb49224, O_RDWR) failed: Permission denied (13) in /usr/local/www/ispcp/gui/include/ispcp-lib.php on line 27"

Which totally makes sense since this directory is only writeble for user "vu2000" and my phpfiles are run using user "www", the apache user. (i found out using phpinfo)

For me it seems like there is a missconfiguration somewhere between Apache(2.22.8) and the php interpreter.

Booth the mod_php5 and the fcgi are loaded as the server header says:
"Server: Apache/2.2.8 (FreeBSD) mod_ssl/2.2.8 OpenSSL/0.9.8e mod_fastcgi/2.4.6 PHP/5.2.6 with Suhosin-Patch"

My question is: How is the setup supposed to be and what settings need I to set so that php is run as vu2000?
It would be quite interesting to see your config files in this case!

If you need further information dont hesitate contact me!
Many thanks in advance!

Marv
06-17-2008 05:56 AM
Find all posts by this user Quote this message in a reply
MrMarv Offline
Junior Member
*

Posts: 14
Joined: Jun 2008
Reputation: 0
Post: #2
RE: How is FastCGI supposed to work?
Hey,

after some working it was not able to figure out which module or whatsoever handles php files.

My /usr/local/etc/apache22/httpd.conf (please have a look on the modules...)
http://nopaste.bsdforen.de/1213726945

and the included /usr/local/etc/apache22/Includes/00_master.conf
http://nopaste.bsdforen.de/1213728992
as well as ispcp.conf
http://nopaste.bsdforen.de/1213727376

This config will prevent php from being parsed!
As you might have seen in 00_master.conf i tried with setting mod_php5 to handle the files. This worked greatly... besides that all the scripts are running as www which prevents the whole script from working, not to speak about the security risk of running a hosting environment like this.

You could make me very happy with posting your working configs, or even an excerpt of them!

Greetings!
(This post was last modified: 06-18-2008 05:04 AM by MrMarv.)
06-18-2008 04:44 AM
Find all posts by this user Quote this message in a reply
Cube Offline
Member
***

Posts: 740
Joined: Apr 2007
Reputation: 9
Post: #3
RE: How is FastCGI supposed to work?
You should not use mod_php5 but fastcgi_ispcp. Do not use the default fastcgi-config. I have no clue about FreeBSD, but on Debian this one can be loaded with "a2enmod fastcgi_ispcp".
06-18-2008 05:13 AM
Find all posts by this user Quote this message in a reply
MrMarv Offline
Junior Member
*

Posts: 14
Joined: Jun 2008
Reputation: 0
Post: #4
RE: How is FastCGI supposed to work?
Hi!

Cube Wrote:You should not use mod_php5 but fastcgi_ispcp. Do not use the default fastcgi-config. I have no clue about FreeBSD, but on Debian this one can be loaded with "a2enmod fastcgi_ispcp".

There is a module called "fastcgi_ispcp" ? It seems that i do not have this one, i searched the whole system but nothing there.

What do you exactly mean by "Do not use the default fastcgi-config"? Which part in my config is this then?

As Debians "a2enmod" only makes symlinks from /etc/apache22/mods-available to mods-enabled AFAIR, could you please tell my what is this module?

Regards!
Marv
06-18-2008 05:36 AM
Find all posts by this user Quote this message in a reply
Cube Offline
Member
***

Posts: 740
Joined: Apr 2007
Reputation: 9
Post: #5
RE: How is FastCGI supposed to work?
I described it not exactly enough. There is no module fastcgi_ispcp, there's only fastcgi. But there is the default-config in mods-available (fastcgi.conf, fastcgi.load) and the ispcp-version (fastcgi_ispcp.conf, fastcgi_ispcp.load) and that's the one you should use.
06-18-2008 06:00 AM
Find all posts by this user Quote this message in a reply
MrMarv Offline
Junior Member
*

Posts: 14
Joined: Jun 2008
Reputation: 0
Post: #6
RE: How is FastCGI supposed to work?
Cube Wrote:I described it not exactly enough. There is no module fastcgi_ispcp, there's only fastcgi. But there is the default-config in mods-available (fastcgi.conf, fastcgi.load) and the ispcp-version (fastcgi_ispcp.conf, fastcgi_ispcp.load) and that's the one you should use.

YEAY! You made my day! Smile
After locating the config file, including it and resetting all the changes i made it seems to work perfekt now!

Neither the fastcgi_ispcp.conf nor fastcgi.conf were included in my apache config since they have been placed in some strange dirs. This might be a FreeBSD related bug/misconfiguration.

I really thank you! Now i am going to have some fun with my fresh CP! Smile

I have the unproven feeling that i will come back to this forum very soon... i would not be surprised of some upcoming errors Wink

Greetings!
06-18-2008 06:18 AM
Find all posts by this user Quote this message in a reply
StevenE Offline
Junior Member
*

Posts: 104
Joined: Feb 2008
Reputation: 0
Post: #7
RE: How is FastCGI supposed to work?
hm,

seems like I've a quite similar problem.
I include fastcgi.conf but the php5-fcgi-starter give me the following

Code:
exec: /usr/local/bin/php-cgi: not found

what should this file be? Tongue sorry got no idea
06-19-2008 07:00 PM
Find all posts by this user Quote this message in a reply
ephigenie Offline
Project Leader
*******
Administrators

Posts: 1,578
Joined: Oct 2006
Reputation: 15
Post: #8
RE: How is FastCGI supposed to work?
You need to have a php(5) interpreter with fastcgi support enabled.
This is usually called php-cgi or php5-cgi try looking into the ports tree perhaps you haven't compiled it yet.
If yes - look at the path - maybe you've to correct it to the right one.
Then edit the php5-fcgi-starter and the fastcgi_ispcp.conf
06-20-2008 07:11 AM
Visit this user's website Find all posts by this user Quote this message in a reply
blocker Offline
Junior Member
*

Posts: 123
Joined: Apr 2007
Reputation: 2
Post: #9
RE: How is FastCGI supposed to work?
When you build php5 from port you must mark "Build CGI version" without it the port wil not build php-cgi file

StevenE Wrote:hm,

seems like I've a quite similar problem.
I include fastcgi.conf but the php5-fcgi-starter give me the following

Code:
exec: /usr/local/bin/php-cgi: not found

what should this file be? Tongue sorry got no idea
06-20-2008 02:34 PM
Find all posts by this user Quote this message in a reply
blocker Offline
Junior Member
*

Posts: 123
Joined: Apr 2007
Reputation: 2
Post: #10
RE: How is FastCGI supposed to work?
MrMarv Wrote:YEAY! You made my day! Smile
After locating the config file, including it and resetting all the changes i made it seems to work perfekt now!

Neither the fastcgi_ispcp.conf nor fastcgi.conf were included in my apache config since they have been placed in some strange dirs. This might be a FreeBSD related bug/misconfiguration.

could you tell us where is fastcgi-Ispcp.conf ? it should be in apache22/extra dir, and yes it had to be manually included in httpd.conf after put # in load php module. since by default it will be run without fastcgi
06-20-2008 03:02 PM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 2 Guest(s)