Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

sampedley's avatar

Shared Hosting without SSH and Laravel

So, a company I'm doing work with wanted a quick solution that I wound up building in Laravel 5. Unfortunately, I found out later that they are very set on hosting it through their GoDaddy shared hosting account and I can't talk them out of it.

The GoDaddy plan they have doesn't allow me to ssh into the box, the only options I have are to ftp my files in and use a few - very limited - c-pannel options.

I have been able to upload all the files and point the document directory to the /public folder in Laravel.

With no changes at all i can see that the initial '/' view is rendering correctly. It goes through my Route::get('/', PageController@index) just fine and even interfaces with the mysql database to return results back to that page - basically meaning the app is functioning exactly as I would expect so far.

However any other route other than the base '/' route will come back with a 500 server error from GoDaddy, not from the laravel app.

Obviously the code functions just fine in homestead, and there is no way for me to look at the error logs.

I've tried a few tutorials that have me mess with the .htaccess file and change the file bath for the bootstrap/autoload.php and app.php files but that didn't seem to help at all.

Any ideas would be greatly appreciated.

0 likes
12 replies
bashy's avatar

GoDaddy have no SSH or log viewing functionality on shared hosting? Knew the company was bad but...that's basic stuff.

Logs would tell you everything. Apache (which I assume they're using) would log the error for either misconfigured htaccess file or something related. Is there no log files in the main login for the control panel?

1 like
Penderis's avatar

Yeah it is tricky without knowing what they changed on the server but in shared hosting I have never had that they actually change the public folders name for me , it usually public_html then offline I make sure I mirror this , so would have root/ then your app files with public renamed to public_html to replace their public_html folder which is already setup so apache knows . My only question could be are you putting public inside public_html or whatever your public folder for the site is? since your public folder must be the main one.

and having the same folder structure offline you can debug before uploading. I also have shared hosting on apache, and my solution always has been to just change my public folder name to whatever my servers is on my local machine and test paths.

Have you asked them for jailed access to ssh?

1 like
sampedley's avatar

I did eventually find logs but I had to manual turn them on and they don't start recording until 24 hours after you turn them on and they only persist for 7 day before being automatically deleted, so I might have to just wait another 19 hours to figure out what's going on.

And the plan my client has allows them to make multiple folders and associate them with domain names. ex site.com would correspond with the /site folder. So I was able to make myapp.com load from the /myapp/public folder. If that makes sense.

And sadly no access to ssh.

Thanks for the help and ideas.

sitesense's avatar

You do have the .htaccess file in the public folder don't you? And rewrite is enabled for the virtual host?

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>

    RewriteEngine On

    # Redirect Trailing Slashes...
    RewriteRule ^(.*)/$ /$1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>
1 like
sampedley's avatar

Yes, I have the .htaccess in the public folder that is exactly like you posted.

Also I believe so, there are other Wordpress installs on the same server that use the .htaccess file for rewrite rules.

sitesense's avatar

Just out of interest, try commenting out the lines below for mod_negotiation. I've not seen that requirement before.

<IfModule mod_rewrite.c>
    # <IfModule mod_negotiation.c>
        Options -MultiViews
    # </IfModule>

    RewriteEngine On

    # Redirect Trailing Slashes...
    RewriteRule ^(.*)/$ /$1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>
1 like
sampedley's avatar

Thanks for the idea but it didn't have any affect.

Still able to load the '/' page without any issue but any other route continues to return a GoDaddy 500 server error.

sitesense's avatar
Level 19

Ok, one last idea, if your site is within a sub-folder, try adding RewriteBase like below. Play around with the sub-folder too, maybe you need something like /my-sub-folder/public/. Just an idea.

    # ...
    RewriteEngine On
    # add here
    RewriteBase /my-sub-folder/  
    # ...

EDIT... another thing I found is that some people suggest adding a forward slash before the index.php part:

RewriteRule ^ /index.php [L]
1 like
sampedley's avatar

THAT WAS IT!!!

The '/' before RewriteRule ^ /index.php [L]

Wow, I can't belive it was that. Thanks so much @sitesense for your help.

lokasees's avatar

please help Internal Server Error 500 i uploaded laravel project with vendor without ssh connection and i get this on log home/us/lucky.us.sy/public/.htaccess: Invalid command 'fModule', perhaps misspelled or defined by a module not included in the server configuration

Please or to participate in this conversation.