Forum

php5 with FastCGI on FreeBSD

Alex
29 March 2011, 10:35
Can any one make a step by step howto for installing php5 with FastCGI on FreeBSD?
This HOWTO [www.hiawatha-webserver.org] is not specifically for FreeBSD.

Thanks in advance.

Hiawatha version: 7.4
Operating System: FreeBSD 8.2
Hugo Leisink
29 March 2011, 15:52
I'm not an expert on FreeBSD, but my guess is that it will be something like going to the right directory in the ports tree and then doing a "make config" and a "make install". But my advice is to ask this question on the FreeBSD forum in order to get the best answer.
Alex
29 March 2011, 17:00
Thanks Hugo,
the installation with ports itself is quite simple, but I can't get it to run php5 with FastCGI and Hiawatha
Hugo Leisink
29 March 2011, 18:27
Are you able to start PHP as a FastCGI daemon via php-fcgi?
Alex
3 April 2011, 02:13
I do not understand it, with Debian it was much easier

ServerBSD# sockstat -4 | less
USER COMMAND PID FD PROTO LOCAL ADDRESS FOREIGN ADDRESS
nobody hiawatha 2088 3 tcp4 *:80 *:*
nobody hiawatha 2088 4 tcp4 61.59.78.41:56117 10.0.0.101:2005
www php-cgi 2066 0 tcp4 61.59.78.41:2005 *:*
root sshd 1782 3 tcp4 61.59.78.41:22 99.152.34.147:25323
root sshd 1683 3 tcp4 61.59.78.41:22 *:*
mysql mysqld 1645 14 tcp4 127.0.0.1:3306 *:*
root ntpd 722 20 udp4 *:123 *:*
root ntpd 722 22 udp4 61.59.78.41:123 *:*
root ntpd 722 25 udp4 127.0.0.1:123 *:*
root syslogd 508 7 udp4 *:514 *:*


Here is HOWTO for FreeBSD [www.cyberciti.biz] but it does not work
René
4 April 2011, 01:30
Example given:

hiawatha.conf
FastCGIserver {
FastCGIid = PHP5
ConnectTo = 192.168.1.155:2005
Extension = php
}

Install /www/spawn-fcgi and edit php-fcgi.conf in /usr/local/etc/hiawatha:
Server = /usr/local/bin/php-cgi ; 127.0.0.1:9000 ; www ; /usr/local/etc/php.ini

Hope this helps...
Hugo Leisink
4 April 2011, 10:23
Why install spawn-fcgi? Hiawatha has its own PHP FastCGI daemon manager. If you edited php-fcgi.conf, just run php-fcgi to start PHP as a FastCGI daemon. I think you are mixing up php-fcgi and spawn-fcgi...
Alex
4 April 2011, 10:42
OK thanks, it works
René
4 April 2011, 13:43
OP was following the wrong howto to ask for a bad example... to get it right!

His best bet was (is) to read between the lines and come up with an example that suits his needs.

hiawatha.conf:
FastCGIserver {
FastCGIid = PHP5
ConnectTo = 127.0.0.1:2005
Extension = php
}


php-fcgi.conf:
Server = /usr/local/bin/php-cgi ; 127.0.0.1:2005 ; www ; /usr/local/etc/php.ini


Run 'php-fcgi' from the command line to whip the daemons.

or am I wrong?
Hugo Leisink
4 April 2011, 13:48
Assuming that you have PHP installed in /usr/local, yes, that should work.
René
4 April 2011, 14:06
Yep. It is a default location for libraries, executables, etc... in FreeBSD.
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/dirstructure.html
This topic has been closed.