DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD Ports and Packages

FreeBSD Ports and Packages Installation and upgrading of ports and packages on FreeBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 5th June 2008
pormogo pormogo is offline
Port Guard
 
Join Date: Jun 2008
Posts: 10
Default Problems getting lighttpd working with php and fcgi

Below is a post I posted recently on the old apparently dying freebsd forums. I thank everyone over there for letting me know that place was dead and that this was the new preferred hangout. I really like the look of this place

I've been using the guide over at nixcraft to install php and lighttpd

http://www.cyberciti.biz/faq/howto-...cgi-php-server/

Everything compiles and installs as expected but I get an error after I uncomment the fcgi section in lighttpd.conf

#### fastcgi module
## read fastcgi.txt for more info
## for PHP don't forget to set cgi.fix_pathinfo = 1 in the php.ini
fastcgi.server = ( ".php" =>
( "localhost" =>
(
"socket" => "/var/run/lighttpd/php-fastcgi.socket",
"bin-path" => "/usr/local/bin/php-cgi"
)
)
)


I think the bold line is the issue as there is no socket in the location that it is referring to. Unfortunately I have no idea how to create the socket. Below is the output from the php-cgi -v command if that is any help at all.

root@weltall:/usr/ports# php-cgi -v
PHP 5.2.6 with Suhosin-Patch 0.9.6.2 (cgi-fcgi) (built: May 24 2008 17:25:53)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies



Thanks in advance for any help.
Reply With Quote
  #2   (View Single Post)  
Old 5th June 2008
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Tcpdump Spy
 
Join Date: Apr 2008
Location: Netherlands
Posts: 2,243
Default

What error are you getting?

Check if the lighttpd user is allowed to write to /var/run/lighttpd, or you can try using something like /tmp/php-fastcgi.socket
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
  #3   (View Single Post)  
Old 5th June 2008
Nightweaver's Avatar
Nightweaver Nightweaver is offline
Fdisk Soldier
 
Join Date: May 2008
Location: Belgrade, Serbia
Posts: 47
Default

Try this:

Code:
fastcgi.server = ( ".php" => ((
                     "bin-path" => "/usr/local/bin/php-cgi",
                     "socket" => "/tmp/php.socket",
                     "max-procs" => 2,
                     "bin-environment" => (
                       "PHP_FCGI_CHILDREN" => "16",
                       "PHP_FCGI_MAX_REQUESTS" => "10000"
                     ),
                     "bin-copy-environment" => (
                       "PATH", "SHELL", "USER"
                     ),
                     "broken-scriptfilename" => "enable"
                 )))
Works just fine for me.
Reply With Quote
  #4   (View Single Post)  
Old 6th June 2008
pormogo pormogo is offline
Port Guard
 
Join Date: Jun 2008
Posts: 10
Default

Yeah setting the path into temp fixed the issue. I was a little confused as to if the socket was supposed to exist at install time or if it was being created when the server was being started. Apparently it's the latter. Everything seems to be working just fine now [face_thumbsup]
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Working with CVS? Zmyrgel OpenBSD General 15 6th October 2009 01:32 PM
wireless not working. bsdnewbie999 OpenBSD General 17 19th July 2009 03:06 AM
lighttpd + PHP on OpenBSD 4.5 amscotti OpenBSD Packages and Ports 6 24th June 2009 11:43 AM
pf: why is that rule not working? ivanatora FreeBSD General 14 11th December 2008 09:32 AM
USB not working after suspend stukov Other BSD and UNIX/UNIX-like 5 11th August 2008 06:48 PM


All times are GMT. The time now is 06:28 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick