Reputation: 3255
I created a new instance on digital ocean and installed laravel (via cloning a git repo I have worked on). I then configured the default config for nginx, but the site is not even remotely accessible.
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /var/www/mfserver/public/;
index index.php index.html index.htm;
server_name IPADDRESS;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location ~ \.php$ {
try_files $uri $uri /index.php$is_args$args;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
The answer in the brwoser is: "SERVERIP is currently unable to handle this request."
The error I get is this in the error.log
PHP message: PHP Fatal error: require(): Failed opening required '/var/www/mfserver/bootstrap/../vendor/autoload.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/mfserver/bootstrap/autoload.php on line 17" while reading response header from upstream,$
Upvotes: 1
Views: 1610
Reputation: 417
The error might have appeared if you haven't downloaded dependencies of Laravel.
Try:
composer install
or
composer update
Upvotes: 2
Reputation: 3288
PHP is unable to open Laravel core files. This is usually because of ownership problems.
Issue this command:
ls -l /var/www/mfserver
Chances are you'll see a list like this.
drwxr-xr-x 3 root root 4096 Apr 27 03:58 bootstrap
That's not right. It needs to be owned by the nginx user, typically www-data
.
Issue this command to fix it:
chown -R www-data:www-data /var/www/mfserver
Upvotes: 1