Uploading images on server using Laravel - php

I've uploaded my website to 000webhost server. there is a problem of images it don't show up when I upload them. it was working fine while I'm on localhost
I moved my public folder to public_html folder on the server but I can't create a symlink on the server I tried this line but it didn't work
symlink('/agroam/agroam/storage/app/public', '/agroam/public_html/storage');
Can anyone tell me why? or give me another way to make it works

Using 000web free hosting symlink is disabled that is why the line doesn't work. You have to upgrade to premium version so you can have SSH access to your account.

Related

Laravel Godaddy hosting: View not Found [Works locally]

I am trying to deploy a Laravel app onto godaddy shared hosting. And have tried several solutions mentioned on this site and others, such as:
-Hosted Laravel 5.4 App shows "View [path.to.viewfile] not found."
-View [auth.login] not found at Shared Hosting Godaddy
However, my views still cannot be found, for some unknown reason that I cannot tell. I have tried the solutions mentioned here, but to no avail.
I checked the spelling of the views since Linux server is case sensitive.
the specific error can be viewed at : auctionSalvages.com
but in short::: View [simpleComponents.HeaderComponents.MainHeader] not found. (View: /home/hostname/AutoShop/resources/views/layouts/main.blade.php)
I have now successfully executed the following php artisan commands: clear-compiled,cache:clear,config:clear,route:clear and view:clear on the server through ssh.
but my view still returns above error..
any more ideas???
This may be a few years too late but here a few things you need to consider if this happened.
Make sure that all the files in the Public folder of your app is copied into the public_html folder of your godaddy hosting site. Make sure that the Settings in your cPanel File Manager (which is generally at the upper right corner) that Show Hidden Files (dotfiles) is checked.
Make sure the you have the .htaccess file in your public_html folder with the correct permissions.
Typically, when you transfer files into your hosting site, you do so by uploading a zip file and then extracting the zip file in the root directory of your site.
And then, when you copy the files from the Public folder of your app, you generally just Select All > Copy > Select public_html
However, sometimes, the files in your Public folder are hidden so you have to set the settings to Show Hidden File (dotfiles) to checked.

Symlink In Laravel 5.4 is created with artisan command. Its working on localhost but not on live server

I have developed a laravel project in laravel 5.4 on xampp localhost.
as on localhost I ued php artisan storage:link to link storage/app/public/images with public/storage to access images. So its working 100% correctly on local host but when I uploaded it on hosting server I lost access to those images. I dont know how can I fix it. please some one help me to make it working.
First delete the shortcut created from localhost (if you have uploaded it to server).
Create a blank php file (like link.php), paste the code below to it:
<?php
symlink('/home/**domain**/storage/app/public', '/home/**domain**/public_html/tests/storage');
In the above code, don't forget to replace domain with the name of the root folder of your domain.
Then upload the file to your public folder (like public_html).
Then on your browser search for your_domain_name/link.php
Hope it will work

How to modify laravel file upload code to work on shared hosting?

I am working on this small laravel project where users need to upload files.
The upload code works fine locally. But fails to work on shared hosting since the directory structure is different.
I use the following line of code to specify where the uploaded file would go
$path = public_path().'/assets/users/'.$request->user()->id;
Locally the file goes to the public folder(public/assets/users/user_id)
of my laravel app. But on shared hosting, it is not allowed to modify the laravel public folder instead it has a public_html which has read/write permissions.
How can I modify the path to work on shared hosting or how do I make it use
public_html/assets instead of trying to use /home/my_user_name/project_folder/public/assets which is not permitted. Thanks in advance.
The simplest way is to move whole project to public_html folder.
You public path should looks like
../some_path/public_html/laravel_app/public
And you point this path to set vhost
Problem solves itself.

Codigniter is not working after uploading to Linux server

Created an application using Codeginiter and is working fine with my local environment which is in XAMPP.
After uploading application folders and files to linux server application is not working at all.
Deployed complete files under "/var/www/html/" and when access from browser it gives me CI error as "404 Page Not Found".
After uploading, I have updated .htaccess file.
I think this is about Linux file permission. You might want to check its file permission.
try to change the permission to read, write and executed by you ONLY example:
sudo chmod 700 var/www/html

Lalavel 5 Give Blank White Page when upload on Shared Hosting (GoDaddy)

I develop Laravel 5 app on localhost. When I upload app on shared hosting it give me blank white page. I am using PHP Version 5.5.20. mod_rewrite is active on shared hosting. Is there any way to work L5 on shared hosting. storage have the 777 permission and other folder have 755 and 644. Debug mode is set to true. Laravel is not generating any error log file. Apache log is also not showing any error. What may be the problem.
I do not know the reason but delete all file from server, run
composer dump-autoload
on localhost and upload all files on server again then it work fine.

Categories