1、Composer安装过程中报错
依次报如下三个函数错误:
proc_open()、putenv()、passthru()
解决办法:
登录宝塔后台:
然后通过后面的“设置”进入“禁用函数”
依次删除proc_open()、putenv()、passthru()三个函数,然后重启php
再次安装 就不报错了
2、站点浏览报跨目录错误
错误如下:
Warning: require(): open_basedir restriction in effect. File(/www/wwwroot/myweb/tp6/vendor/autoload.php) is not within the allowed path(s): (/www/wwwroot/myweb/tp6/public/:/tmp/) in /www/wwwroot/myweb/tp6/public/index.php on line 15
Warning: require(/www/wwwroot/myweb/tp6/vendor/autoload.php): failed to open stream: Operation not permitted in /www/wwwroot/myweb/tp6/public/index.php on line 15
Fatal error: require(): Failed opening required '/www/wwwroot/myweb/tp6/public/../vendor/autoload.php' (include_path='.:') in /www/wwwroot/myweb/tp6/public/index.php on line 15
这是因为如Thinkphp、Larvel等框架的运行目录为子目录 public ,而项目执行需要上层目录的文件,因此这里报错,解决办法:(以/www/wwwroot/qinsercmf为例)如下图:
1、去掉“防跨站攻击” 选项
2、网站目录指向/www/wwwroot/qinsercmf这一层即可,
3、运行目录选择/public (其实也就是上面选择的/www/wwwroot/qinsercmf/目录下的pubic)
4、重启此站点:(停止然后再开启)
OK 可以正常访问了: