Laravel on Shared Hosting unable to find path to files - php

I was able to run my Laravel 5.3 application very well on my local machine. But when I upload it to the shared hosting, I have the following error.
InvalidArgumentException in FileViewFinder.php line 137:View [welcome] not found.
I also observed that while on the online server, the application is looking for the files in the path they are on my local machine
I only have a shared hosting and so cannot run PHP Artisan commands. I have tried to
php artisan cache:clear
and
php artisan config:cache
and yet the problem persists.
I have even manually deleted all the files in storage/framework/views but the problem persists.
My local machine is a MAC OS with XAMPP with PHP 7 and my shared hosting is a CentOS Linus server with PHP 5.6.

It sounds like you need to clear the auto loader cache by running the following command on the server
composer dump-auto -o
Once the command has completed it will update the vendor autoload paths and the application should work correctly.

Try adding this in your web route file
Route::get('/updateapp', function()
{
exec('composer dump-autoload');
echo 'composer dump-autoload complete';
});

Related

Failed to remove directory when using php cache:clear

When using composer install or cache:clear it will fail.
Failed to remove directory "/vagrant/download-server/var/cache/..8bS": rmdir(/vagrant/download-server/var/cache/..8bS): Text file busy
Previously when this error came up i could change from using a shared vm folder to direcly deploying
into the machine via phpstorm and this would fix it.
So i guess it has something to do with writing/reading speed.
Other than deploying directly into the vm. I also updated Vbox but this did not help.

Deploy Laravel Project on Dreamhost but not working

I have uploaded all files in dreamhost server and also point our domain to public directory. But when I open website it is showing site not found. Below is website link.
https://laraveleqn.samiflabs.com/
I have direct uploaded all files from local xampp, in that it is working fine..so should I execute all command like key:generate, composer install again ?
Any help will be appreciated..
Thanks
Hi Samif, There is not any specific reason to solve the kind of error
but some conclusion for solve the error.
First you can check .env file in your server.
composer install and clear cache via
php artisan config:cache
php artisan config:clear
php artisan cache:clear
And finally not solved then try to Dump and Die on index.php in public folder

laravel failed to open stream fatal error when running php artisan serve command

i had recently installed laravel in windows through composer made a new project named project in my xamp's htdocs folder then run "php artisan serve" comand in cmd but it is giving me error "failed to open stream" here is screenshot here I ran "php artisan serve" comand error is shown in above image I also tried to search my problem on stack overflow but couldn't find any solution that can suit my problem
Most files are missing because you have not successfully installed Laravel.
Go to C:\xampp\htdocs\project> and type composer update --no-scripts or composer install
Since you are using xampp, once all the necessary files and packages are downloaded to your project you should be able to access your site through localhost without running php artisan serve by visiting
http://localhost/project/public
NB:Just ensure xampp is running
please go through the documentation first
https://laravel.com/docs/5.4#installation
you did not installed laravel projects correctly. you did not have vendor files. First you have to run :
composer install
dont need php artisan serve in xampp ... just go to
localhost/your_project/public
hope it helps !!!

Vendor:Publish - Nothing to publish for tag [] - Only on production server

I am using a third party library and locally, I installed everything using the steps that they provided.
I ran composer require on the package and ran an update. This installed into the vendor folder.
I then added the path into the provider in config/app and also as an aliases..
I ran php artisan vendor:publish --provider="Spatie\LaravelAnalytics\LaravelAnalyticsServiceProvider" the config file created successfully and I had no problems.
I then uploaded to the production environment and kept on getting Class 'LaravelAnalytics' not found and I can't seem to figure out the problem..
I ran php artisan vendor:publish --provider="Spatie\LaravelAnalytics\LaravelAnalyticsServiceProvider"
But I kept on getting: Nothing to publish for tag []. which has lead me to thinking that this could be the problem since the package is not published.
My local environment is Ubuntu and my production Environment is CentOS.. If I try to CD into that directory on my production environment it says cannot find.
Could this therefore be a problem with the case sensitive on how I am adding my providers that is not picking up this package?
are you using cached config files ?
try using
php artisan config:clear
and retry
php artisan vendor:publish
You have to save all for the project before (php artisan vendor:publish).

Laravel 5.0 - Shared Hosting - Artisan not working as it should

I actually wanted to follow up on this question, but I guess It's better to start a new question.
I installed a fresh copy of my own laravel(5.0), and I tried running php artisan route:list, which works.
Now I have downloaded the compressed repository of a project I want to deploy on a shared hosting enviorment, but when I run php artisan route:list nothing happens.(No error message, nothing). Using this method for hosting the application
The actual problem is php artisan migrate, which also outputs nothing!
Is there a good method for troubleshooting this ?
Could you provide me we some points of failure that I can check ?
Worth mentioning:
I'm no Laravel developer and I have limited time reading up on it.
As LittleFinger suggested, it's possible that artisan is not actually yet installed. When deploying from a repo, Laravel's packages of which the entire framework core is composed, are not included. You should run composer install to install the packages. If you don't have composer installed that can be difficult on shared hosting, but it's usually possible to install it.
You will need to run composer install before you run composer update. Running composer update is not required, unless you want to update to the newest versions of your packages which are allowed by the rules in your composer.json file. This should be done with care in a production environment as new versions of packages could break your app.
Once you've installed the packages, you'll need to set your environment variables (database credentials etc.) by copying the .env.example file to .env and editing it. Once you've done this you'll be able to run php artisan key:generate to generate an encryption key.
After this, your app should work (assuming you've pointed a domain to the /public directory).
I am facing the same issue when I try to run
php artisan migrate or php artisan cache:clear
nothing happen just a blank screen no success no error see the screenshot
after debugging I found a message in error_log in root directory which says.
Fatal Error: Allowed Memory Size
after increasing the memory php artisan commands works fine

Categories