企業(yè)網(wǎng)站 手機(jī)網(wǎng)站 app 微網(wǎng)站廣州網(wǎng)站建設(shè)系統(tǒng)
項(xiàng)目場(chǎng)景:
在CentOS8中安裝了寶塔,配置thinkphp5.1版本環(huán)境時(shí)出了問(wèn)題,在此之前網(wǎng)站虛擬域名成功配置,能夠訪問(wèn)站點(diǎn)創(chuàng)建成功的頁(yè)面
問(wèn)題描述:
在訪問(wèn)tp5默認(rèn)頁(yè)面時(shí)報(bào)錯(cuò)
Warning: require(): open_basedir restriction in effect. File(/home/wwwroot/xxxxxx/thinkphp/start.php) is not within the allowed path(s): (/home/wwwroot/xxxxxx/public/:/tmp/:/proc/) in /home/wwwroot/xxxxxx/public/index.php on line 16Warning: require(/home/wwwroot/xxxxxx/thinkphp/start.php): failed to open stream: Operation not permitted in /home/wwwroot/xxxxxx/public/index.php on line 16Fatal error: require(): Failed opening required ‘/www/wwwroot/xxxxxx/public/../thinkphp/start.php’ (include_path=’.:/usr/local/php/lib/php’) in /home/wwwroot/xxxxxx/public/index.php on line 16
原因分析:
起初看英文提示,以為是文件缺少,隨后找了一下,發(fā)現(xiàn)文件都是在的。然后第二段警告提示了權(quán)限不足,又去修改權(quán)限,還是不行。后來(lái)發(fā)現(xiàn)是open_basedir的問(wèn)題,那么有兩個(gè)方法來(lái)解決這個(gè)問(wèn)題。
解決方案:
1、在設(shè)置網(wǎng)站目錄中,不要勾選防跨站攻擊,問(wèn)題解決。
2、進(jìn)入/www/server/nginx/conf目錄下,找到fastcgi.conf,修改其中的一個(gè)參數(shù)’fastcgi_param PHP_ADMIN_VALUE’,沒(méi)有的話可以自己加一個(gè),/www/wwwroot是你的項(xiàng)目路徑,每個(gè)人可能都不一樣
fastcgi_param PHP_ADMIN_VALUE "open_basedir=/www/wwwroot/:/tmp/:/proc/";
兩種方法任選其一即可
發(fā)布者:全棧程序員棧長(zhǎng),轉(zhuǎn)載請(qǐng)注明出處:https://javaforall.cn/172110.html原文鏈接:https://javaforall.cn
Fatal error: require(): Failed opening required ‘/www/wwwroot/xxxxxx/public/../thinkphp/start.php-騰訊云開發(fā)者社區(qū)-騰訊云 (tencent.com)