sinthu225
sinthu225

Reputation: 311

PHP site developed using Laravel 5 is not getting rendered after Hosting

I developed a php site using Laravel 5 and tried hosting it in a LAN Server running UBUNTU 14. But when I navigated the page I'm just getting a Blank Page. No errors at all. I inserted a simple echo statement in index.php and I got the relevant echo.

Upvotes: 1

Views: 211

Answers (3)

pinkal vansia
pinkal vansia

Reputation: 10330

There can be many reason. If you are using Laravel 5.0, you will need at least PHP 5.4. For Laravel 5.1, you will need 5.5.9. But if you have installed PHP using sudo apt-get install php5 you are most likely to have PHP 5.5.9 or later. Because that is the default version for Ubuntu 14.04 LTS. try running php -v from terminal to check the version.

There can also be a Permission issue for storage folder. From project root folder run following command,

sudo chmod 755 -R storage

Basically, laravel needs write access to storage folder to write a log in storage/log directory or to write a compiled view files in storage/framework/views etc. You can try 755 first. If that does not work try 777.

Upvotes: 1

Khan Shahrukh
Khan Shahrukh

Reputation: 6411

I believe you have permissions issue chmod 755 storage folder located in the root of your web project. If that doesn't works do it 777.

The reason why echo in the index.php is working is because this is the first file called when you execute the laravel app and the index file calls services provider and other required files, in this process the app creates a cache file under storage/framework/views/ folder but these files does not have write permissions, but as you echo something you get that output because it has been called even before anything was called.

Upvotes: 0

2250990
2250990

Reputation: 21

Laravel shows nothing on certain fatal errors. For instance a class that can't be found or the storage directory and subdirectories that should be writable for the web user (www-data). This should show up in the error log of the webserver.

Upvotes: 0

Related Questions