安装命令
nginx
1
|
./configure --prefix=/usr/local/nginx --with-http_v2_module --with-http_ssl_module --with-http_gzip_static_module
|
php
1
|
./configure --prefix=/usr/local/php --enable-mysqlnd --enable-fpm --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --enable-mbstring --enable-bcmath --with-openssl --with-curl --with-zlib
|
open_basedir
错误提示
1
|
Warning: require(): open_basedir restriction in effect. File(xxx) is not within the allowed path(s): (/xxx/:/tmp/:/proc/) in /index.php on line 22
|
错误原因
1
|
fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/";
|
解决方法
lnmp安装时自动追加了以上内容到fastcgi.conf, 其作用是限定文件引入等操作只能在root的定义 tmp proc 三个目录下进程, 可有些实际情况是php经常引入自己或者第三方的库文件,而且这些库文件不在root目录下,所以导致程序引入文件报错,可注释此行解决,也可以添加目录。