Hello all,

while working on some projects i encountered some difficulties making my laravel powered web apps run on shared hosting.

Not all clients can afford dedicated servers or cloud hosting, so i must fit in the powerful framework to accommodate their budget. I found a way to get around this, hope it helps other developers out there.

Without the steps below you get a 404 error while trying to navigate your web app on shared hosting, this can be really frustrating.

Image result for 404 not found

So here is what i did.

STEP1: CREATE A .HTACCESS FILE

In the Laravel’s webapp root directory(where the web app itself resides, for example if the webapp is in your public_html put it there, if its in another folder create the htaccess file there, create a .htaccess file (i take it you know how to do that, if not please use the comment or ask me). Then enter the following information.


Options +FollowSymLinks
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

STEP2: CREATE A .php.ini FILE

You can either just create a .php.ini file or go to your php configuration and make a custom entry, either way enter this code.


allow_url_fopen = ON
allow_url_include = ON

STEP3: CREATE A .user.ini FILE

You can either make a custom entry at your php configuration or create the file, either way you should enter this.


allow_url_fopen = ON

Thats it, save the files and enjoy the power of laravel.

Comments

comments

SHARE
Previous articleExposing a Facebook scammer Out to scam Students
Next articleHow to copy content from websites that restricts content copy
John Onyejegbu
John Loves to code!!! He loves engaging in challenging tasks, identifying problems in our society and using technology to solve those problems!!! I am a strong software developer with an extensive background in all part of the software development lifecycle. My unique career has given me Experience in not only development, but project management, database design and management, software testing, quality assurance, and disaster recovery planning.