First, it is well discouraged to use a shared hosting for your Laravel 5 app. There are other very cheap web hosting starting from USD $7 per month...
Some comments have been hidden by the post's author - find out more
For further actions, you may consider blocking this person and/or reporting abuse
It's ok on my local. but when i upload it on my hosting, I have this error.
Forbidden
You don't have permission to access /index.php on this server.
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
Can you please tell me how to fix it. thank you.
I had this error. Firstly, there could be a file on the host that is already rerouting you via the .htaccess. After sorting this, then my host required a php.ini in the root directory and this needed to be a "production one" as opposed to a local one. Then bootstrap/cache/config.php had hard-coded references to my local PC, but not compatible with the hosting platform. With that the 500 Internal Service error was gone.
Change the file access permissions for public folder, the permission error will disappear, everything should work normally now, unless you missed a step :)
also you can use this --> github.com/faryar76/lrm
package to run migrations and upload files without ssh
Hi,
How about having more than 1 laravel app in the same shared hosting?
I'm trying to upload a second app using a subdomain for example:
test.mydomain.com points to public_html/test
But does not works for me... but if I upload a HTML file with dummy text and I type mydomain.com/test it's ok!
How can I have more than 1 laravel app (different files, different public folder, different everything) in the same shared hosting (CPANEL)
Thanks u and sorry for my poor english.
You can do this with a subdomain or addon domain. When you have your subdomain or addon domain ready, follow the author's step. The only difference is that you do everything in the directory created by your subdomain or addon domain.
Don't forget to edit these two lines of codes to match your directory structure:
require DIR.'/../vendor/autoload.php';
$app = require_once DIR.'/../bootstrap/app.php';
I strongly recommend setting this up on a local server like xampp before uploading it to your server.
Hello did you solve it if any one have more than one app
Nope, I didn't. :(
I never recommend shared hosting for Laravel applications. There are so many problems with it. Instead you can use DigitalOcean, Linode or Vultr. Amazon web services is a good choice. You can also checkout Cloudways for one click deployment of Laravel Applications:
cloudways.com/blog/install-laravel...
Illuminate \ Database \ QueryException (1045)
SQLSTATE[HY000] [1045] Access denied for user 'rozeline_row'@'localhost' (using password: YES) (SQL: select * from
users
wherenid
= 55555555 limit 1)... I have got stuck here. rozeline_row is granted with all the privileges. what to do now?
The error is self explanatory, it means you’re using a wrong password for the specified database user, make sure the password matches the database configuration in your .env file
I have error Class 'PDO' not found, is that exception related to this tutorial?
Nah, I think this is as a result of bad PDO installation or php.ini config file, try to install or reinstall PDO extension then restart server.
The error actually means PDO class does not exist,
Hello,
I have developed a laravel project first time. It works fine in local.
I have VPS-1000 hosting from inmotion inmotionhosting.com/managed-vps-ho...
Which method i should follow. is it a shared hosting?
So far i tried your mentioned technique
create a folder in root folder laravel and upload all my projects files into it
then move public folder to public_html/subdomain folder
change the autoload and bootstrap path in index file (followed this 4. change the following lines (22 and 36))
update my env and config/database file with my database credential
it given an error : SQLSTATE[HY000] [2002] Connection refused (SQL: select * from information_schema.tables where table_schema =
used localhost instead 127.0.0.1 and also tried to change port 3306 to 33060 but failed
also i have tried.. upload full projects into public_html/subdomain folder and use htaccess to locate public index file. But same error.
Can you please tell me how to fix it. thank you.
It seems to be working fine but one problem is that while I am trying to delete some resource lets say Post. I have used:
if($editor->image != null) {
unlink(public_path().'/uploads/editor/'.$editor->image);
}
I am unable to go to that path where the image is located. How to reach that path so that I can unlink it.
After using your method to deploy my laravel app, all the pages loaded clean and easy. Big thanks for that bro. Although i have an issue with files i store in the storage/app/public directory. Uploading images to that directory is always successful but it seems impossible for me to view images from that directory to the blade view
Storage::disk('local')->url('file.jpg')
seems to work on my local server but does not work on the remote server.I did not use
asset('storage/file.jpg')
because I am not permitted to create a symlink on the host with ssh or php artisanLet us take a look at the default Laravel 5 application structure:
app //directory
contains restricted server-side application data
app/storage //directory
contains a writeable directory used by Laravel 5 and custom functions to store data ( i.e. log files, etc... )
public //diectory
this directory is accessible to anyone on the web.
If I were you, I would upload the file to the public directory directly.
Try this:
Output // http://www.your-domain.com/img/filename.jpg
Great man. I finally uploaded using this way. Everything was ok. But server gives me error 500. I didn't find out. So I go to config/app.php and made debug true to find out error and set up app-key by hard coding. Then running ok
Great!
HI,
Thank you for the tutorial. But as I did the same that you have mentioned, all my css, js, images are not getting displayed on the browser. What should I do, as I have checked my path also. Please help.
SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: NO) (SQL: select * from
sessions
whereid
= eRLLuTsdfGhYugsApdfgsdfgujtikyuh2ygfiAZ9ePXig limit 1)i didn't use to check it on my local server like using apache and my sql i straight forward upload the laraval app to my subdomain directory
i upload the vpn app laravel project to a subdomain directory and make the database and assign the user to database but when i am run the domain than the error i got is
You don't have permission to access this resource.
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
please help me
i am trying to deploy a laravel application on hostinger.in. everything is working fine except one thing.the image uploaded by the user is stored on my files but cannot be viewed.i have stored all the files in the public folder into public_html folder and rest of the files are on the root directory i tried symlink yet it was of no use,please help
Hello dear i appreciate the team effort here and i found this community very helpful,
i have an issue and i hope i will get it here very soon
i upload the vpn app laravel project to a subdomain directory and make the database and assign the user to database but when i am run the domain than the error i got is
You don't have permission to access this resource.
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
please help me
Hi, Thanks for saving my day...!
I have an ultimate (goDaddy) plan where i host multiple web apps. That is add on domains are added and those directories are inside public_html. What will I do in this case? Where i need to put project folder and contents in public directory?
how to generate key ,
as per instructions this command is needed Run this command for key generation
php artisan key:generate
Migration and seeding
php artisan migrate --seed
Installing dependencies
composer install
Folder Permissions
sudo chmod -R 777 storage bootstrap/cache
This is very hard for continuous integration and continuous deployment. The right way to deploy should be according to this article 👇
medium.com/@hafizmohammedg/how-to-...
I am deploying on a sub domain using laravel 5.7, but I am unable to locate the index.php file in root directory of subdomain.
Ok, the index.php is located in public directory, but the listed changes is not making the app running.
Thanks a lot. I was having a problem deploying a laravel project of mine. But now it's fixed.
You are welcome, am glad to hear that,
Cheers :)
This really help me on a no-framework php I created.
Glad this is working for us 😊
Totally works like a charm ... Thanks for sharing
Am glad it also worked for you. Cheers :)
when i'm public folder content move public_html but more than 2 project how to handle this
Thank you!
Anytime mate 🙋♂️
Thank you! I needed it to start a project. I explain to clients that a shared hosting has its limitations, it is good to start but I also make recommendations to improve over time.
add
Order allow,deny
Deny from all
to the .htaccess file to prevent your .env file from being publicly accessible
Awesome!
Life saver!! Thanks a lot, man.
You're welcome
Nice! This article really helped out, Thanks
Cheers. Am glad it worked for you
If we're making changes to the path of Laravel's public directory. Wouldn't it be wise to let Laravel know about it by binding the paths as discussed in the given below article?
shade.codes/how-to-deploy-laravel-...
The login is not valid, the contents are correct!
Anyone knows how to solve it????
No help from anyone!!!
Do you have tutorial for deploying Laravel app on Digitalocean?
First, it is well discouraged to use a shared hosting for your Laravel 5 app, Why ?
Nice piece of write up, but you didn't remember to mention setting up .env configuration variables.
I've Laravel 5.6 application and I was following your steps, but there is nothing showing when I open my application site in browser. It's blank. Can you please help me?
Try to view source code in browser emulator
There is a small php script that can do the job for laravel 7. I already tried it and it saved me a lot of time. Here is the link: laravel-deployer.planethoster.world/
thanks!
Glad it worked for you.
Hi. I tried this. but when i open the page, it is blank. I checked source, and It did not render my component
Nice article, it worked for me in my laravel app 5.2 but the rest pages apart from the homepage is not working.