-2

I installed a new Laravel project with composer on linux with nginx server, but when I visit the project in browser,it shows an http 500 error.this was the php error log from the nginx.

[01-Feb-2018 19:38:50] WARNING: [pool www] child 4475 said into stderr: "NOTICE: PHP message: PHP Warning:  require(): open_basedir restriction in effect. File(/home/wwwroot/blog/vendor/autoload.php) is not within the allowed path(s): (/home/wwwroot/blog/public/:/tmp/:/proc/) in /home/wwwroot/blog/public/index.php on line 24"

[01-Feb-2018 19:38:50] WARNING: [pool www] child 4475 said into stderr: "NOTICE: PHP message: PHP Warning:  require(/home/wwwroot/blog/vendor/autoload.php): failed to open stream: Operation not permitted in /home/wwwroot/blog/public/index.php on line 24"

[01-Feb-2018 19:38:50] WARNING: [pool www] child 4475 said into stderr: "NOTICE: PHP message: PHP Fatal error:  require(): Failed opening required '/home/wwwroot/blog/public/../vendor/autoload.php' (include_path='.:/usr/local/php/lib/php') in /home/wwwroot/blog/public/index.php on line 24"

I have googled this error,but none resolved my problem.Any one could help me?

(edit : syntaxe)

Mathieu Ferre
  • 4,246
  • 1
  • 14
  • 31
kerby
  • 103
  • 13
  • Possible duplicate of [open\_basedir restriction in effect. File(/) is not within the allowed path(s):](https://stackoverflow.com/questions/1846882/open-basedir-restriction-in-effect-file-is-not-within-the-allowed-paths) – Sapnesh Naik Feb 01 '18 at 12:01

1 Answers1

0

Did you give writeable permission to bootstrap and storage folder ? Its common mistake in linux enviorment. Another common mistake we give writable permission to index.php

  1. Give RWX permission by filemanager or terminal like: `sudo chmod -R bootstrap storage'
  2. Remove group writable permission to index.php
sumit sharma
  • 698
  • 5
  • 16
  • I have solved my problem,it was in the fastcig config file.I removed one line in this file :#fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/"; – kerby Feb 01 '18 at 13:54