I'm starting use laravel for a project. I've installed it like it's suggested on the official documentation, hovever, if I type laravel new projectname after I navigate to the macOS sites folder, It will give this errors
host:~ z$ laravel new kcms
Crafting application...
PHP Fatal error: Uncaught Error: Call to undefined method Symfony\Component\Process\Process::fromShellCommandline() in /Users/z/.composer/vendor/laravel/installer/src/NewCommand.php:84
Stack trace:
#0 /Users/z/.composer/vendor/symfony/console/Command/Command.php(255): Laravel\Installer\Console\NewCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /Users/z/.composer/vendor/symfony/console/Application.php(886): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#2 /Users/z/.composer/vendor/symfony/console/Application.php(262): Symfony\Component\Console\Application->doRunCommand(Object(Laravel\Installer\Console\NewCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 /Users/z/.composer/vendor/symfony/console/Application.php(145): Symfony\Component\Console\Applicat in /Users/z/.composer/vendor/laravel/installer/src/NewCommand.php on line 84
Fatal error: Uncaught Error: Call to undefined method Symfony\Component\Process\Process::fromShellCommandline() in /Users/z/.composer/vendor/laravel/installer/src/NewCommand.php on line 84
Error: Call to undefined method Symfony\Component\Process\Process::fromShellCommandline() in /Users/z/.composer/vendor/laravel/installer/src/NewCommand.php on line 84
Call Stack:
0.0002 394608 1. {main}() /Users/z/.composer/vendor/laravel/installer/bin/laravel:0
0.0081 1414560 2. Symfony\Component\Console\Application->run() /Users/z/.composer/vendor/laravel/installer/bin/laravel:13
0.0202 1807648 3. Symfony\Component\Console\Application->doRun() /Users/z/.composer/vendor/symfony/console/Application.php:145
0.0203 1807648 4. Symfony\Component\Console\Application->doRunCommand() /Users/z/.composer/vendor/symfony/console/Application.php:262
0.0204 1807648 5. Laravel\Installer\Console\NewCommand->run() /Users/z/.composer/vendor/symfony/console/Application.php:886
0.0209 1812424 6. Laravel\Installer\Console\NewCommand->execute() /Users/z/.composer/vendor/symfony/console/Command/Command.php:255
what's wrong?
You will need to run the following command as the global version is not compatible or outgrade with the local one.
composer global update
or
composer global update laravel/installer
Related
The website randomly went down and I can't figure out how to correct the following error. I have tried toggling all plugins, the server was recently updated to PHP 7.4 from PHP 7.3 but no other website has had this issue.
My Setup:
PHP - PHP 7.4.11 (cli) (built: Oct 8 2020 17:32:43)
uname - Debian 4.19.146-1 (2020-09-17) x86_64 GNU/Linux
MySQL - mysql Ver 15.1 Distrib 10.3.23-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
Error from the website:
Fatal error: Uncaught Error: Call to undefined function wp_cache_add()
in /WEBSITE_PATH/wp-includes/option.php:258 Stack trace: #0
/WEBSITE_PATH/wp-includes/functions.php(1717): wp_load_alloptions() #1
/WEBSITE_PATH/wp-includes/load.php(664): is_blog_installed() #2
/WEBSITE_PATH/wp-settings.php(159): wp_not_installed() #3
/WEBSITE_PATH/wp-config.php(99): require_once('/home/swcsoldie...') #4
/WEBSITE_PATH/wp-load.php(37): require_once('/home/swcsoldie...') #5
/WEBSITE_PATH/wp-blog-header.php(13):
require_once('/home/swcsoldie...') #6 /WEBSITE_PATH/index.php(22):
require('/home/swcsoldie...') #7 {main} thrown in
/WEBSITE_PATH/wp-includes/option.php on line 258
Fatal error: Uncaught Error: Call to undefined function wp_cache_add()
in /WEBSITE_PATH/wp-includes/option.php:258 Stack trace: #0
/WEBSITE_PATH/wp-includes/option.php(116): wp_load_alloptions() #1
/WEBSITE_PATH/wp-includes/l10n.php(69): get_option() #2
/WEBSITE_PATH/wp-includes/l10n.php(137): get_locale() #3
/WEBSITE_PATH/wp-includes/l10n.php(828): determine_locale() #4
/WEBSITE_PATH/wp-includes/class-wp-fatal-error-handler.php(46):
load_default_textdomain() #5 [internal function]:
WP_Fatal_Error_Handler->handle() #6 {main} thrown in
/WEBSITE_PATH/wp-includes/option.php on line 258
Code from Line 258:
wp_cache_add( 'alloptions', $alloptions, 'options' );
An undefined function error in PHP is fatal error, and means you're calling a function that doesn't exist (at least, at the point and scope it's being called at). Most often, I'd wager 9/10 times, this happens while you're developing and you mistype a function name, str_repace instead of str_replace, for instance.
With all of that being said, wp_cache_add() is a WordPress Core function defined in /wp-includes/cache.php, and is being called by a core file: /wp-includes/option.php on line 258.
Since these core files, and core functions are triggering a fatal "undefined function" error, it means your WordPress installation is failing somewhere. It possibly got corrupted during an update of some kind - it's infrequent, but it does happen for any number of reasons.
To fix this: try reinstalling WordPress, as it is absolutely compatible with PHP 7.4.
I have my magento ecommerce website hosted on Godaddy. It is version 1.9.2.2. I attempted to restore a database backup but I got a 503 service unavailable error. So I decided to attempt the entire files backup. In the process I got a system and an exception error below. I am not sure whether the site broke when I attempted the database restore or the files restore.
Fatal error: Uncaught TypeError: Argument 1 passed to Mage_Core_Model_Store::setWebsite() must be an instance of Mage_Core_Model_Website, null given, called in /home/tre76767667/public_html/app/code/core/Mage/Core/Model/App.php on line 645 and defined in /home/tre76767667/public_html/app/code/core/Mage/Core/Model/Store.php:453
Stack trace:
#0 /home/tre76767667/public_html/app/code/core/Mage/Core/Model/App.php(645): Mage_Core_Model_Store->setWebsite(NULL)
#1 /home/tre76767667/public_html/app/code/core/Mage/Core/Model/App.php(477): Mage_Core_Model_App->_initStores()
#2 /home/tre76767667/public_html/app/code/core/Mage/Core/Model/App.php(360): Mage_Core_Model_App->_initCurrentStore('', 'store')
#3 /home/tre76767667/public_html/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#4 /home/tre76767667/public_html/index.php(68): Mage::run('', 'store')
#5 {main} thrown in /home/tre76767667/public_html/app/code/core/Mage/Core/Model/Store.php on line 453
In the error_log I got this:
[11-Dec-2019 21:09:02 UTC] PHP Notice: Undefined index: SCRIPT_NAME in /home/tre76767667/public_html/cron.php on line 40
[11-Dec-2019 21:09:02 UTC] PHP Notice: Undefined index: SCRIPT_FILENAME in /home/tre76767667/public_html/cron.php on line 41
Please can someone help me with how I can solve this?
I have a laravel project I installed the composer
and run
composer install
After that I executed the update command
composer update
on the project's root directory, and during the execution on the command
php artisan optimize
I got the error shown in the attached image.
When I try to execute any php artisan command I got the same error too.
Error lines
PHP Fatal error: Uncaught Error: Call to undefined method Illuminate\Support\Facades\Auth::check() in C:\xampp\htdocs\projectx\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php:221
Stack trace:
#0 C:\xampp\htdocs\projectx\app\Exceptions\Handler.php(39): Illuminate\Support\Facades\Facade::__callStatic('check', Array)
#1 C:\xampp\htdocs\projectx\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\HandleExceptions.php(81): App\Exceptions\Handler->report(Object(Symfony\Component\Debug\Exception\FatalThrowableError))
#2 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleException(Object(Symfony\Component\Debug\Exception\FatalThrowableError))
#3 {main}
thrown in C:\xampp\htdocs\projectx\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php on line 221
PHP Fatal error: Uncaught Error: Call to undefined method Illuminate\Support\Facades\Auth::check() in C:\xampp\htdocs\projectx\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php:221
Stack trace:
#0 C:\xampp\htdocs\projectx\app\Exceptions\Handler.php(39): Illuminate\Support\Facades\Facade::__callStatic('check', Array)
#1 C:\xampp\htdocs\projectx\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\HandleExceptions.php(81): App\Exceptions\Handler->report(Object(Symfony\Component\Debug\Exception\FatalErrorException))
#2 C:\xampp\htdocs\projectx\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\HandleExceptions.php(123): Illuminate\Foundation\Bootstrap\HandleExceptions->handleException(Object(Symfony\Component\Debug\Exception\FatalErrorException))
#3 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleShutdown()
#4 {main}
thrown in C:\xampp\htdocs\projectx\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php on line 221
You could try to use the append_config() helper method in your environment app configuration file:
'providers' => append_config(array(
'LocalOnlyServiceProvider',
))
The command php artisan optimize has been remove in laravel 5.6
see more: https://laravel.com/docs/5.6/upgrade
I'm working on migrating from Ubuntu 14 to 16 and php 5.5 to 7. When I'm trying to turn on my application, I keep running into an ErrorHandler Fatal Error. Does anyone know a quick way to resolve this?
ubuntu#dev2:/var/www/xyz$ php app/console
PHP Fatal error: Uncaught TypeError: Argument 1 passed to Symfony\Component\Debug\ErrorHandler::handleException() must be an instance of Exception, instance of Error given in /var/www/xyz/vendor/symfony/symfony/src/Symfony/Component/Debug/ErrorHandler.php:436
Stack trace:
#0 [internal function]: Symfony\Component\Debug\ErrorHandler->handleException(Object(Error))
#1 {main}
thrown in /var/www/xyz/vendor/symfony/symfony/src/Symfony/Component/Debug/ErrorHandler.php on line 436
This is my Laravel error:
FatalErrorException in compiled.php line 6376:
Class 'Illuminate\Html\HtmlServiceProvider' not found
in compiled.php line 6376
at HandleExceptions->fatalExceptionFromError(array('type' => '1', 'message' => 'Class 'Illuminate\Html\HtmlServiceProvider' not found', 'file' => '/home/nl/Laravel/storage/framework/compiled.php', 'line' => '6376')) in compiled.php line 1721
at HandleExceptions->handleShutdown()
And my console error:
Generating autoload files
PHP Fatal error: Class 'Illuminate\Html\HtmlServiceProvider' not found in /home
/nl/Laravel/storage/framework/compiled.php on line 6376
PHP Stack trace:
PHP 1. {main}() /home/nl/Laravel/artisan:0
PHP 2. Illuminate\Foundation\Console\Kernel->handle() /home/nl/Laravel/artisan
:36
PHP 3. Illuminate\Foundation\Console\Kernel->bootstrap() /home/nl/Laravel/vend
or/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:92
PHP 4. Illuminate\Foundation\Application->bootstrapWith() /home/nl/Laravel/ven
dor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:195
PHP 5. Illuminate\Foundation\Bootstrap\RegisterProviders->bootstrap() /home/nl
/Laravel/storage/framework/compiled.php:1307
PHP 6. Illuminate\Foundation\Application->registerConfiguredProviders() /home/
nl/Laravel/storage/framework/compiled.php:1758
PHP 7. Illuminate\Foundation\ProviderRepository->load() /home/nl/Laravel/stora
ge/framework/compiled.php:1404
PHP 8. Illuminate\Foundation\ProviderRepository->compileManifest() /home/nl/La
ravel/storage/framework/compiled.php:6338
PHP 9. Illuminate\Foundation\ProviderRepository->createProvider() /home/nl/Lar
avel/storage/framework/compiled.php:6362
PHP Fatal error: Uncaught exception 'UnexpectedValueException' with message 'Th
e stream or file "/home/nl/Laravel/storage/logs/laravel-2015-04-20.log" could no
t be opened: failed to open stream: Permission denied' in /home/nl/Laravel/stora
ge/framework/compiled.php:12372
Stack trace:
#0 /home/nl/Laravel/storage/framework/compiled.php(12431): Monolog\Handler\Strea
mHandler->write(Array)
#1 /home/nl/Laravel/storage/framework/compiled.php(12313): Monolog\Handler\Rotat
ingFileHandler->write(Array)
#2 /home/nl/Laravel/storage/framework/compiled.php(12081): Monolog\Handler\Abstr
actProcessingHandler->handle(Array)
#3 /home/nl/Laravel/storage/framework/compiled.php(12179): Monolog\Logger->addRe
cord(400, 'exception 'Symf...', Array)
#4 /home/nl/Laravel/vendor/laravel/framework/src/Illuminate/Foundation/Exception
s/Handler.php(47): Monolog\Logger->error('exception 'Symf...')
#5 /home/nl/Laravel/app/Exceptions/Handler.php(27): Illuminate\Foundation\Except
ions\Handler->report(Object(Symfony\Component\Debug\Exception\FatalErrorExceptio
n))
#6 in /home/nl/Laravel/storage/framework/compiled.php on line 12372
PHP Stack trace:
PHP 1. {main}() /home/nl/Laravel/artisan:0
PHP 2. Illuminate\Foundation\Console\Kernel->handle() /home/nl/Laravel/artisan
:36
PHP 3. Illuminate\Foundation\Console\Kernel->bootstrap() /home/nl/Laravel/vend
or/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:92
PHP 4. Illuminate\Foundation\Application->bootstrapWith() /home/nl/Laravel/ven
dor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:195
PHP 5. Illuminate\Foundation\Bootstrap\RegisterProviders->bootstrap() /home/nl
/Laravel/storage/framework/compiled.php:1307
PHP 6. Illuminate\Foundation\Application->registerConfiguredProviders() /home/
nl/Laravel/storage/framework/compiled.php:1758
PHP 7. Illuminate\Foundation\ProviderRepository->load() /home/nl/Laravel/stora
ge/framework/compiled.php:1404
PHP 8. Illuminate\Foundation\ProviderRepository->compileManifest() /home/nl/La
ravel/storage/framework/compiled.php:6338
PHP 9. Illuminate\Foundation\ProviderRepository->createProvider() /home/nl/Lar
avel/storage/framework/compiled.php:6362
Script php artisan clear-compiled handling the post-update-cmd event returned wi
th an error
[RuntimeException]
Error Output: PHP Fatal error: Class 'Illuminate\Html\HtmlServiceProvider'
not found in /home/nl/Laravel/storage/framework/compiled.php on line 6376
PHP Stack trace:
PHP 1. {main}() /home/nl/Laravel/artisan:0
PHP 2. Illuminate\Foundation\Console\Kernel->handle() /home/nl/Laravel/ar
tisan:36
PHP 3. Illuminate\Foundation\Console\Kernel->bootstrap() /home/nl/Laravel
/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:92
PHP 4. Illuminate\Foundation\Application->bootstrapWith() /home/nl/Larave
l/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:195
PHP 5. Illuminate\Foundation\Bootstrap\RegisterProviders->bootstrap() /ho
me/nl/Laravel/storage/framework/compiled.php:1307
PHP 6. Illuminate\Foundation\Application->registerConfiguredProviders() /
home/nl/Laravel/storage/framework/compiled.php:1758
PHP 7. Illuminate\Foundation\ProviderRepository->load() /home/nl/Laravel/
storage/framework/compiled.php:1404
PHP 8. Illuminate\Foundation\ProviderRepository->compileManifest() /home/
nl/Laravel/storage/framework/compiled.php:6338
PHP 9. Illuminate\Foundation\ProviderRepository->createProvider() /home/n
l/Laravel/storage/framework/compiled.php:6362
PHP Fatal error: Uncaught exception 'UnexpectedValueException' with messag
e 'The stream or file "/home/nl/Laravel/storage/logs/laravel-2015-04-20.log
" could not be opened: failed to open stream: Permission denied' in /home/n
l/Laravel/storage/framework/compiled.php:12372
Stack trace:
#0 /home/nl/Laravel/storage/framework/compiled.php(12431): Monolog\Handler\
StreamHandler->write(Array)
#1 /home/nl/Laravel/storage/framework/compiled.php(12313): Monolog\Handler\
RotatingFileHandler->write(Array)
#2 /home/nl/Laravel/storage/framework/compiled.php(12081): Monolog\Handler\
AbstractProcessingHandler->handle(Array)
#3 /home/nl/Laravel/storage/framework/compiled.php(12179): Monolog\Logger->
addRecord(400, 'exception 'Symf...', Array)
#4 /home/nl/Laravel/vendor/laravel/framework/src/Illuminate/Foundation/Exce
ptions/Handler.php(47): Monolog\Logger->error('exception 'Symf...')
#5 /home/nl/Laravel/app/Exceptions/Handler.php(27): Illuminate\Foundation\E
xceptions\Handler->report(Object(Symfony\Component\Debug\Exception\FatalErr
orException))
#6 in /home/nl/Laravel/storage/framework/compiled.php on line 12372
PHP Stack trace:
PHP 1. {main}() /home/nl/Laravel/artisan:0
PHP 2. Illuminate\Foundation\Console\Kernel->handle() /home/nl/Laravel/ar
tisan:36
PHP 3. Illuminate\Foundation\Console\Kernel->bootstrap() /home/nl/Laravel
/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:92
PHP 4. Illuminate\Foundation\Application->bootstrapWith() /home/nl/Larave
l/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:195
PHP 5. Illuminate\Foundation\Bootstrap\RegisterProviders->bootstrap() /ho
me/nl/Laravel/storage/framework/compiled.php:1307
PHP 6. Illuminate\Foundation\Application->registerConfiguredProviders() /
home/nl/Laravel/storage/framework/compiled.php:1758
PHP 7. Illuminate\Foundation\ProviderRepository->load() /home/nl/Laravel/
storage/framework/compiled.php:1404
PHP 8. Illuminate\Foundation\ProviderRepository->compileManifest() /home/
nl/Laravel/storage/framework/compiled.php:6338
PHP 9. Illuminate\Foundation\ProviderRepository->createProvider() /home/n
l/Laravel/storage/framework/compiled.php:6362
I refer to this tutorial, and am following these steps:
1."illuminate/html": "5.*"
2.Run: composer update
3.Add to the app.php providers array:
'Illuminate\Html\HtmlServiceProvider',
4.Add to the app.php aliases array:
'Html' => 'Illuminate\Html\HtmlFacade',
'Form' => 'Illuminate\Html\FormFacade',
but still not work, someone could give some advice?
I've found there is a bit of an issue with that library that composer requires - try changing:
"illuminate/Html" : "5.0.*"
To..
"Illuminate/Html": "5.0.*#dev"
in the composer.json in the root of your laravel project.
I fall this problem,solve this and wrote a blog about it.For use laravel html helper you need to require this dependency in your composesr.josn file and need to require those file.For full process follow this url http://www.kingpabel.com/laravel-html-helper/