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
Related
Nowhere on the internet have I seen anyone have this issue, but I pretty much can't change or add any config/package/vendor without restarting my entire Linux server.
Some simple examples:
For Intervention image, I set the driver to Imagick in config/image, in the controller itself Image::configure(['driver' => 'imagick']), AND in the vendor file itself (/vendor/intervention/image/src/...). No matter what, it continued to try to use GD until I restarted the entire server.
I installed the CloudConvert package with Composer, and added it to providers and facades. Nothing at all worked until a total reboot.
Before anyone asks, I've tried:
php artisan cache:clear
php artisan config:cache
deleting the whole cache folder
composer dump-autoload
composer install
composer update
All of the above did nothing at all. I still need to reboot everything. Does this sound familiar to anyone?
Heey!
So I've recently been given the task to take a Laravel 5.2 up to 5.6. It seemed to be fine...until I tried to do a \Log::info(). Every time I run that, I get a big error, but at the end, it still prints to the log. I saw the 5.6 documentation on creating the config/logger.php. I took a fresh copy of it from github. The only thing I did after that was set an env variable for the LOG_CHANNEL to be single. Here's the error I get:
[2018-03-02 08:28:59] laravel.EMERGENCY: Unable to create configured logger. Using emergency logger. {"exception":"[object] (InvalidArgumentException(code: 0): Log [] is not defined. at I:\xampp\htdocs\mtm\vendor\laravel\framework\src\Illuminate\Log\LogManager.php:181)
[ ....
I did a file comparison between Laravel 5.2 and 5.6. I'm not seeing anything that jumps out that would break the Logging functionality.
Has anyone run into this with a Laravel upgrade?
Add this file to your config folder
https://github.com/laravel/laravel/blob/5.6/config/logging.php
and add this to your .env file LOG_CHANNEL=stack
Don't forget to run php artisan config:clear command afterwards.
I was facing the same issue due to upgrade of my laravel version from 5.3 to 5.7. But after search of few mints i found the solution.
You just need to follow the following steps.
create logging.php file inside the config folder.
Copy code from this Official Link of Laravel.
Past this code into your logging.php file.
run this command -- php artisan config:clear
All done. Happy Coding :)
I got the same problem and tried to do everything as you did but not work.
Finally, I've found that it was because of cached config, just clear it and everything will be fine:
php artisan config:clear
I recently had the same error in my development machine (and not in the production one, oddly). In my development machine I have both php 7.1 and php 7.2 installed. Checking with phpinfo(), I discovered that 7.1 was the default version, so I decided to switch to 7.2.
sudo a2dismod php7.1
sudo a2enmod php7.2
sudo systemctl restart apache2
That didn't solve the problem (but maybe was part of it).
After several hours spent on trying everything suggested around the web, I found my solution by:
Checking all the permissions in the storage folder.
In my project folder, clearing all the cache(s) and config(s).
Dumping all composer autoload files.
In detail:
cd your_project_full_path
sudo chmod -R 0775 storage
sudo chown -R www-data:www-data storage
php artisan config:clear
php artisan view:clear
php artisan route:clear
composer dump-autoload
After this, I had no problem any more. Maybe try 0755 as permission for the storage folder. Hope this helps!
use upgrade guide , and add logging.php to your config files.
After two days of some research, I found a solution on Github.
If you are using Laravel 5.5.4 to Laravel 5.6.*, then you can just install and configure the exceptions package by Graham Campbell.
Link: https://github.com/GrahamCampbell/Laravel-Exceptions
This worked perfectly for me on Mac OSX (PHP 7.1.7), Laravel 5.6.22
My initial error:
2018-05-25 14:35:07] laravel.EMERGENCY: Unable to create configured logger.
Using emergency logger. {"exception":"[object] (InvalidArgumentException(code: 0): Log [] is not defined. at /Users/pro/Sites/metiwave/vendor/laravel/framework/src/Illuminate/Log/LogManager.php:181)
In my case, APP_LOG= was blank in .env file so I saved it as APP_LOG=single and it worked.
I had the same issue, turns out I had accidentally moved the config folder. If you find yourself in the same situation, (probably as embarrassed as I am) move it back to the root folder of your project.
Regards
all right, i got it
take a look at the official library, copy log config configuration code :
link :https://github.com/laravel/laravel/blob/5.6/config/logging.php
create in your project's config directory logging.php file
copy the code in
clear the cache :php artisan config:clear
that's it. keep stomping ...
I am trying to install Symfony on CentOS Linux wih PHP 5.6 and cPanel installed.
When I run composer require symfony/assetic-bundle , once adding bundle to the AppKernelphp, symfony (app/console too) stops working and keeps logging this error:
[10-Jun-2016 22:00:57 UTC] PHP Fatal error: Class 'Symfony\Bundle\AsseticBundle\AsseticBundle' not found in /home/avid24/public_html/app/AppKernel.php on line 19
After checking the vendor directory, turns out that composer has downloaded a single compressed file with a random name, I could extract it with unzip. but problem still exists!
This environment works properly on windows and I could easily update symfony and its components using composer.
Any help? Anyone with the same experience ?
Well, I eventually figured out the problem!
I enabled suhosin extension which prevents the composer and other similar command prompt php scripts from a proper execution.
As a temporary solution I copied php.ini and disabled unnecessary extensions and put it next to my project and call composer this way
$php -c ../composer-php.ini ~/composer ......
I'll create a script to make the life easier
I didn't find any resource which describes coexistence of composer and suhosin extension, so I'm not sure if this is the ultimate solution but the root cause is identified.
If anybody makes workaround this subject I'd be more than happy to know about it.
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).
Today, I pulled down the laravel/laravel repository from Github. I then ran php composer.phar install (as I normally would on my system, with a command window in the project directory). However, when I ran php composer.phar update, I received this error:
Everything installed just fine, and Laravel works as it should.
Any ideas what could be causing this issue?
Edit 1
artisan exists in the root of the project, but it throws an exception when I attempt to run php artisan optimize:
Side Note 1
If I try the alternative method (quicker) of installing Laravel (php composer.phar create-project laravel/laravel), I get the following:
Edit 2
Upon installation, I also get the same error, where it claims it cannot find artisan. Therefore, the installation does not fully complete. I believe that it is stopping when it wants to compile classes (or something to that effect), and then write bootstrap/compiled.php. That file doesn't exist.
Here's the snap from the install:
Edit 3
It seems that Composer is looking for artisan in the drive root (C:\). Why is it doing this? Even if I specify -d on the update, it throws the error. (I picked this up from a hunch - simply copied artisan to the root of the drive and it found it - albeit, it obviously did not run...)
Solution Found:
Composer makes calls to php artisan <command> (as per the instruction in composer.json > scripts), but it does not see what directory it is running from (perhaps because it is an external command?).
So, I solved my initial problem by using an absolute path to artisan in composer.json.
Everything is working now. I just wish I knew how to get Composer to know that it is running from C:\LocalServer\lab\laravel, and not just C:\.
As i can see, your artisan file is missing. Can you post the exact steps on how you install it ?
Also, please follow http://laravel.com/docs/installation and http://niallobrien.me/2013/03/installing-and-updating-laravel-4/
I had this problem today too. My laravel folder inside the vendor was deleted after composer update. I ran composer install again and problem resolved.