You are not logged in.
Hello,
I decided to swith my server from Ubuntu to Arch a few days ago due in part from the great reviews of Arch.
However I have not been able to get php working yet.
what I did first was to install Nginx via pacman
no problems with that and works fine
next I installed php and xcache via pacman
running php -v from my terminal I get:
PHP 5.2.5 with Suhosin-Patch 0.9.6.2 (cgi-fcgi) (built: Nov 13 2007 20:03:00)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
with XCache v1.2.1, Copyright (c) 2005-2007, by mOo
Next I installed fastcgi from the lighttpd source by downloading the tar, unpacking and running ./configure and make.
moved spawn-fcgi by doing:
cp src/spawn-fcgi /usr/bin/spawn-fcgi
created the file usr/bin/php-fastcgi and added the following:
#!/bin/sh
/usr/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -f /usr/bin/php-cgi
next the file /etc/rc.d/init-fastcgi chmod'ed to 755 and added:
#!/bin/bash
PHP_SCRIPT=/usr/bin/php-fastcgi
RETVAL=0
case "$1" in
start)
$PHP_SCRIPT
RETVAL=$?
;;
stop)
killall -9 php
RETVAL=$?
;;
restart)
killall -9 php
$PHP_SCRIPT
RETVAL=$?
;;
*)
echo "Usage: php-fastcgi {start|stop|restart}"
exit 1
;;
esac
exit $RETVAL
and lastly changed /etc/nginx/conf/nginx.conf to include:
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include conf/fastcgi_params;
fastcgi_param SCRIPT_FILENAME /etc/nginx/html$fastcgi_script_name;
}
After rebooting here's what I get now:
When I run /etc/rc.d/init-fastcgi start
I get the output:
spawn-fcgi.c.186: child spawned successfully: PID: 27970
When I run php -v I get:
/dev/zero: No space left on device
Failed creating file mappping
PHP 5.2.5 with Suhosin-Patch 0.9.6.2 (cgi-fcgi) (built: Nov 13 2007 20:03:00)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
with XCache v1.2.1, Copyright (c) 2005-2007, by mOo
When I go to my domain nginx serves up html but going to a php page with phpinfo() I get:
No input file specified.
I'm really not sure what's going on here and any help will be greatly appreciated I really want to stay with Arch but also need it to work.
Last edited by signalb (2007-12-09 23:51:24)
Offline
Not sure what is happening with your php config.
Try shutting down the service (/etc/rc.d/init-fastcgi stop), and starting php-fastcgi manually from the command line.
Also, there isn't really a need to use lighttpd's start script. Php can do it itself, you just need a bash script to launch it..
example link: http://blog.kovyrin.net/2006/05/30/ngin … cgi-howto/
You might try setting the php.ini
cgi.fix_pathinfo=1
Not sure if it is needed, as I don't do a *whole* lot with php anymore.
I love nginx though.
"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍
Offline
Is indeed /etc/nginx/html the path to your site root directory?
Offline
It is, I don't know what's going on. I know other people had trouble with using relative versus absolute paths but I checked and rechecked my path info and my php.ini so not sure what the deal is.
Offline
maybe post the output of php -i somewhere in a nopaste site and link to it here...
could be some weird issue with the php.ini
"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍
Offline
Does it works with XCache disabled?
Maybe this helps: http://forum.lighttpd.net/topic/7188
Offline
No input file specified.
that you get because fastcgi_param SCRIPT_FILENAME doesn't point to where you have your PHP files.
fastcgi_param SCRIPT_FILENAME /etc/nginx/html$fastcgi_script_name;
you have the test file at /etc/nginx/html/testfile.php ?
nginx installs to /usr/local/nginx/html by default
xcache.mmap_path string
for *nix, xcache.mmap_path is a file path, not directory. for win32, xcache.mmap_path is anonymous map name, not a file path. Use something like "/tmp/xcache" if you want to turn on ReadonlyProtection, 2 group of php won't share the same /tmp/xcache.
xcache.mmap_path is set to /dev/zero by default, perhaps that's the problem.
Offline
so, did something worked out ?
Offline
I had a hell of a time too, then I got smart and asked in #nginx on irc.
you need to add index.php to the / location{}
location / {
root /path/root;
index index index.html index.htm index.php;
}
I got php/fcgi + nginx + mysql + wordpress up and runnning with great results. This fix will only help if you are getting errors in the logs about index.php not existing.
I am not sure, but I think the problem lies in the fact that fastcgi_index doesn't work as it once did or is not the correct way to use it. I found another blog that had relevant information suggesting to add index.php to / loaction {} and all worked out.
Last edited by jacko (2009-03-24 21:58:59)
Offline
fwiw, there are various fcgi (fastcgi) packages in AUR.
< Daenyth> and he works prolifically
4 8 15 16 23 42
Offline
When I use a init script, can I use the user nginx and group nginx? This is so I can copy some premade script available throughout the internet.
Birger
Offline