September 21, 2009 05:44AM Registered: 6 months ago
Posts: 4
After some tweaking the problem came to the surface. It was the "open_basedir" option in php.ini. You should point that parameter to your document root directory like /var/www or /src/http. It should be the same as the "root" option in this section:
location ~ \.php$ {
root /var/www;
include /usr/local/nginx/conf/fastcgi_params;
fastcgi_pass localhost:9000;
fastcgi_index index.php;
}
Thanks for the help.
blo
http://forum.nginx.org/read.php?11,7965,8079
------
nah ini yang di file php.ini-nya
open_basedir ="/www:/var/tmp"
upload_max_filesize = 8M
NOTES:
/www padake karo "root" sing di set nengi" location"
/var/tmp yen iki tmp default'e engine X
8M gen upload iso luweh ginuk-ginuk
padahal safe_mode=off lo, tapi kok open_basedir yo isih ngaruh?
----
Selanjutnya permasalah nginx dengan moodle, pada saat mengakses file "file.php". Intinya file tersebut berhubungan dengan slash sama backward, jadi di nginx.conf perlu sysntac kayak berikut ini
# >>FastCGI<<
location ~ \.php(.*)$ {
root /www/E-GURU;
fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
if (!-e $request_filename) {
rewrite ^(.*\.php)(/)(.*)$ $1?file=/$3 last;
}
}
}
# >> end of php<<
-----
>>php-cgi.sh , buat on-off in phpnya di nginx <<
PROVIDES=php-cgi
LIGHTTPD_FCGI=/usr/local/bin/spawn-fcgi
SERVER_IP=127.0.0.1
SERVER_PORT=9000
SERVER_USER=nginx
SERVER_GROUP=nginx
PHP_CGI=/usr/local/bin/php-cgi
PHP_FCGI_CHILDREN=10
PGREP=/bin/pgrep
KILLALL=/usr/bin/killall
### No editing below ####
cmd=$1
pcgi_start(){
echo "Starting $PROVIDES..."
$LIGHTTPD_FCGI -a $SERVER_IP -p $SERVER_PORT -u $SERVER_USER -g $SERVER_GROUP -f $PHP_CGI -C $PHP_FCGI_CHILDREN
}
pcgi_stop(){
echo "Killing $PROVIDES..."
$KILLALL $PROVIDES
}
pcgi_restart(){
pcgi_stop
sleep 1
pcgi_start
}
pcgi_status(){
$PGREP $PROVIDES > /dev/null
[ $? -eq 0 ] && echo "$PROVIDES running" || echo "$PROVIDES NOT running"
}
pcgi_help(){
echo "Usage: $0 {start|stop|restart|status}"
}
case ${cmd} in
[Ss][Tt][Aa][Rr][Tt]) pcgi_start;;
[Ss][Tt][Oo][Pp]) pcgi_stop;;
[Rr][Ee][Ss][Tt][Aa][Rr][Tt]) pcgi_restart;;
[Ss][Tt][Aa][Tt][Uu][Ss]) pcgi_status ;;
*) pcgi_help ;;
esac
No comments:
Post a Comment