Laravel example project on PhpStorm is not compileable - laravel

I am very new to using Frameworks/Laravel and I haven't achieved to run the Laravel welcome website in PhpStorm yet.
Steps I've done so far:
I have created a new "Composer Project" with PhpStorm and chose Laravel as Package.
I installed the IDE helper in line with this tutorial: http://blog.jetbrains.com/phpstorm/2015/01/laravel-development-using-phpstorm/
I installed XAMPP and started the Apache server on port 8000
Changed the PhpStorm Settings -> Language & Frameworks -> PHP -> Interpreter -> Path to php.exe inside of XAMPP
I tried to watch the results in a browser by clicking "Run". A PHP fatal error appeared in the debugger which said the class TestCase couldn't be found.
After googling I added the phpunit.xml as an alternative configuration file for my Run/Debug configurations. Furthermore I read that I need to add the "tests" folder inside of my project directory as "Directory Test Scope" there.
The debugger says "All Tests passed", but I am receiving a different fatal error which I wasn't able to solve until now:
Fatal error: Call to undefined method
PHPUnit_Framework_TestResult::deprecatedFeaturesCount() in
C:\xampp\php\pear\PHPUnit\TextUI\ResultPrinter.php on line 446
Fatal error: Uncaught exception
'Illuminate\Contracts\Container\BindingResolutionException' with
message 'Target [Illuminate\Contracts\Debug\ExceptionHandler] is not
instantiable.' in C:\Users\kentor\PhpstormProjects\test
Laravel\vendor\laravel\framework\src\Illuminate\Container\Container.php:752
Stack trace:
0 C:\Users\kentor\PhpstormProjects\test Laravel\vendor\laravel\framework\src\Illuminate\Container\Container.php(633):
Illuminate\Container\Container->build('Illuminate\Cont...', Array)
#1 C:\Users\kentor\PhpstormProjects\test Laravel\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(697):
Illuminate\Container\Container->make('Illuminate\Cont...', Array)
#2 C:\Users\kentor\PhpstormProjects\test Laravel\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\HandleExceptions.php(154):
Illuminate\Foundation\Application->make('Illuminate\Cont...')
#3 C:\Users\kentor\PhpstormProjects\test Laravel\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\HandleExceptions.php(79):
in C:\Users\kentor\PhpstormProjects\test
Laravel\vendor\laravel\framework\src\Illuminate\Container\Container.php
on line 752 PHP
Fatal error: Call to undefined method
PHPUnit_Framework_TestResult::deprecatedFeaturesCount() in
C:\xampp\php\pear\PHPUnit\TextUI\ResultPrinter.php on line 446 PHP
Fatal error: Uncaught exception
'Illuminate\Contracts\Container\BindingResolutionException' with
message 'Target [Illuminate\Contracts\Debug\ExceptionHandler] is not
instantiable.' in C:\Users\kentor\PhpstormProjects\test
Laravel\vendor\laravel\framework\src\Illuminate\Container\Container.php:752
Stack trace:
#0 C:\Users\kentor\PhpstormProjects\test Laravel\vendor\laravel\framework\src\Illuminate\Container\Container.php(633):
Illuminate\Container\Container->build('Illuminate\Cont...', Array)
#1 C:\Users\kentor\PhpstormProjects\test Laravel\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(697):
Illuminate\Container\Container->make('Illuminate\Cont...', Array)
#2 C:\Users\kentor\PhpstormProjects\test Laravel\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\HandleExceptions.php(154):
Illuminate\Foundation\Application->make('Illuminate\Cont...')
#3 C:\Users\kentor\PhpstormProjects\test Laravel\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\HandleExceptions.php(79):
in C:\Users\kentor\PhpstormProjects\test
Laravel\vendor\laravel\framework\src\Illuminate\Container\Container.php
on line 752
Process finished with exit code 255
So in the end I want to see the contents of my "Public" folder.
My questions:
Why did I need to specify the "tests" folder? Is this used for verifying that PHP is compiling correctly or any similar testing stuff?
What did I miss in order to see my Laravel example page in the end?

Related

Fatal error: Uncaught Error: Call to undefined function wp_unregister_GLOBALS() when upgrading to 5.5

I have WordPress running on Windows 10 with IIS.
While upgrading WordPress to 5.5 this morning I received the following error:
PHP Fatal error: Uncaught Error: Call to undefined function wp_unregister_GLOBALS() in C:\inetpub\wwwroot\wordpress\wp-settings.php:70 Stack trace: #0 C:\inetpub\wwwroot\wordpress\wp-config.php(92): require_once() #1 C:\inetpub\wwwroot\wordpress\wp-load.php(37): require_once('C:\inetpub\wwwr...') #2 C:\inetpub\wwwroot\wordpress\wp-admin\admin.php(34): require_once('C:\inetpub\wwwr...') #3 C:\inetpub\wwwroot\wordpress\wp-admin\index.php(10): require_once('C:\inetpub\wwwr...') #4 {main} thrown in C:\inetpub\wwwroot\wordpress\wp-settings.php on line 70
This was a very easy fix. Since my installation was local I just copied all the files and directories located in the WordPress 5.5 upgrade folder (in my case it was C:\inetpub\wwwroot\wordpress\wp-content\upgrade\wordpress-5.5-no-content-cIBdh3\wordpress) to the root of the site (in my case C:\inetpub\wwwroot\wordpress) overwriting the file already there.
Very simple fix. I guess the installation hit something while it was copying or timedout, who knows. I'm sure you can do the same thing by FTPing to your site if you are hosting your site remotely.
i am updating to 5.5 in my hostiing and i got this problem, the solution is You should upload all and folder file update except wp-content but it depends

PHP Fatal error: Uncaught Error: Call to undefined function simplexml_load_string() in public_html/lib/Varien/Simplexml/Config.php:510

I'm getting this error. Can you please help me understand why it is coming and what does it mean. I did not change any code. It is running on PHP 7.1 and Operating system is Linux.
PHP Warning: PHP Startup: SourceGuardian: Unable to initialize module
Module compiled with module API=20160303
PHP compiled with module API=20170718
These options need to match in Unknown on line 0
PHP Fatal error: Uncaught Error: Call to undefined function
simplexml_load_string() in public_html/lib/Varien/Simplexml/Config.php:510
Stack trace:
#0 /home3/ramesqj3/public_html/lib/Varien/Simplexml/Config.php(498):
Varien_Simplexml_Config->loadString('<?xml version="...',
'Mage_Core_Model...')
#1/home3/ramesqj3/public_html/app/code/core/Mage/Core/Model/Config.php(277):
Varien_Simplexml_Config->loadFile('/home3/ramesqj3...')
#2 /home3/ramesqj3/public_html/app/code/core/Mage/Core/Model/App.php(391):
Mage_Core_Model_Config->loadBase()
#3 /home3/ramesqj3/public_html/app/code/core/Mage/Core/Model/App.php(304):
Mage_Core_Model_App->_initBaseConfig()
#4 /home3/ramesqj3/public_html/app/code/core/Mage/Core/Model/App.php(348):
Mage_Core_Model_App->baseInit(Array)
#5 /home3/ramesqj3/public_html/app/Mage.php(686): Mage_Core_Model_App-
>run(Array)
#6 /home3/ramesqj3/public_html/index.php(83): Mage::run('', 'store')
#7 {main}
thrown in public_html/lib/Varien/Simplexml/Config.php on line 510

Composer fails on capistrano deploy "phpseclib/bootstrap.php: failed to open stream"

So, running cap production deploy now fails and gives me this log:
DEBUG [d8e9f9b4] Generating autoload files
DEBUG [d8e9f9b4] > Illuminate\Foundation\ComposerScripts::postInstall
DEBUG [d8e9f9b4] PHP Warning: Uncaught ErrorException: require(/some_path/releases/20161101100659/vendor/phpseclib/phpseclib/phpseclib/bootstrap.php): failed to open stream: No such file or directory in /some_path/releases/20161101100659/vendor/composer/autoload_real.php:55
Stack trace:
#0 /some_path/releases/20161101100659/vendor/composer/autoload_real.php(55): Composer\Util\ErrorHandler::handle(2, 'require(/srv/us...', '/path/...', 55, Array)
#1 /some_path/releases/20161101100659/vendor/composer/autoload_real.php(55): require()
#2 /some_path/releases/20161101100659/vendor/composer/autoload_real.php(45): composerRequire28a339249b76e8c9bd2081b3b12636da('decc78cc4436b12...', '/path/...')
#3 /some_path/releases/20161101100659/vendor/autoload.php(7): ComposerAutoloaderInit28a339249b76e8c9bd2081b3b12636da::getLoader()
#4 /some_path/releases/201611011006 in /some_path/releases/20161101100659/vendor/composer/autoload_real.php on line 55
DEBUG [d8e9f9b4]
Warning: Uncaught ErrorException: require(/some_path/releases/20161101100659/vendor/phpseclib/phpseclib/phpseclib/bootstrap.php): failed to open stream: No such file or directory in /some_path/releases/20161101100659/vendor/composer/autoload_real.php:55
Stack trace:
#0 /some_path/releases/20161101100659/vendor/composer/autoload_real.php(55): Composer\Util\ErrorHandler::handle(2, 'require(/path/...', '/path/...', 55, Array)
#1 /some_path/releases/20161101100659/vendor/composer/autoload_real.php(55): require()
#2 /some_path/releases/20161101100659/vendor/composer/autoload_real.php(45): composerRequire28a339249b76e8c9bd2081b3b12636da('decc78cc4436b12...', '/path/...')
#3 /some_path/releases/20161101100659/vendor/autoload.php(7): ComposerAutoloaderInit28a339249b76e8c9bd2081b3b12636da::getLoader()
#4 /some_path/releases/201611011006 in /some_path/releases/20161101100659/vendor/composer/autoload_real.php on line 55
DEBUG [d8e9f9b4] PHP Fatal error: composerRequire28a339249b76e8c9bd2081b3b12636da(): Failed opening required '/some_path/releases/20161101100659/vendor/phpseclib/phpseclib/phpseclib/bootstrap.php' (include_path='.:/opt/sp/php7.0/lib/php') in /some_path/releases/20161101100659/vendor/composer/autoload_real.php on line 55
DEBUG [d8e9f9b4]
Fatal error: composerRequire28a339249b76e8c9bd2081b3b12636da(): Failed opening required '/some_path/releases/20161101100659/vendor/phpseclib/phpseclib/phpseclib/bootstrap.php' (include_path='.:/opt/sp/php7.0/lib/php') in /some_path/releases/20161101100659/vendor/composer/autoload_real.php on line 55
It worked fine before I changed JWT lib from 0.5.9 to 1.0.0.alpha and added laravelconnect/remote package.
Note: this all works on my local machine. I've no idea why phpsec doesn't have bootstrap.php file in it. On my local machine it does have it.

Bugsnag error when running artisan command

I got this error when trying to run my php artisan migrate on my production server...
PHP Fatal error: Uncaught exception 'Exception' with message 'Bugsnag Error: Invalid API key' in /var/app/current/vendor/bugsnag/bugsnag/src/Bugsnag/Client.php:19
Stack trace:
#0 /var/app/current/vendor/bugsnag/bugsnag-laravel/src/Bugsnag/BugsnagLaravel/BugsnagLaravelServiceProvider.php(61): Bugsnag_Client->__construct(NULL)
#1 /var/app/current/vendor/laravel/framework/src/Illuminate/Container/Container.php(738): Bugsnag\BugsnagLaravel\BugsnagLaravelServiceProvider->Bugsnag\BugsnagLaravel\{closure}(Object(Illuminate\Foundation\Application), Array)
#2 /var/app/current/vendor/laravel/framework/src/Illuminate/Container/Container.php(631): Illuminate\Container\Container->build(Object(Closure), Array)
#3 /var/app/current/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(674): Illuminate\Container\Container->make('bugsnag', Array)
#4 /var/app/current/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(62): Illuminate\Foundation\Application->make('bugsnag', Array)
#5 /var/app/current/vendor/bugsnag/bugsna in /var/app/current/vendor/bugsnag/bugsnag/src/Bugsnag/Client.php on line 19
PHP Fatal error: Uncaught exception 'Exception' with message 'Bugsnag Error: Invalid API key' in /var/app/current/vendor/bugsnag/bugsnag/src/Bugsnag/Client.php:19
Stack trace:
#0 /var/app/current/vendor/bugsnag/bugsnag-laravel/src/Bugsnag/BugsnagLaravel/BugsnagLaravelServiceProvider.php(61): Bugsnag_Client->__construct(NULL)
#1 /var/app/current/vendor/laravel/framework/src/Illuminate/Container/Container.php(738): Bugsnag\BugsnagLaravel\BugsnagLaravelServiceProvider->Bugsnag\BugsnagLaravel\{closure}(Object(Illuminate\Foundation\Application), Array)
#2 /var/app/current/vendor/laravel/framework/src/Illuminate/Container/Container.php(631): Illuminate\Container\Container->build(Object(Closure), Array)
#3 /var/app/current/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(674): Illuminate\Container\Container->make('bugsnag', Array)
#4 /var/app/current/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(62): Illuminate\Foundation\Application->make('bugsnag', Array)
#5 /var/app/current/vendor/bugsnag/bugsna in /var/app/current/vendor/bugsnag/bugsnag/src/Bugsnag/Client.php on line 19
I ran env on the command line and I have an env variable called BUGSNAG_API_KEY and the value of it exactly matches the key at bugsnag.com for this project.
Furthermore, I have this line in my project at ./config/bugsnag.php
'api_key' => env('BUGSNAG_API_KEY'),
Weirdly, I eventually tried the same command again (php artisan migrate) and it worked! But it's left me very unsettled as it's a production server. So I'd like to understand the problem.
Errors seem to be logging in Bugsnag as well by the way.
Try to regenerate the configuration cache with php artisan config:cache. It will use the current data from the .env file to generate a new configuration cache. This worked for me.
In case this helps anyone...
The Bugsnag Git Repo mentions this issue:
(Uncaught exception 'ReflectionException' with message 'Class bugsnag.logger does not exist'
Github user GrahamCampbell suggested that what is actually happening is that another error exists, but it's "...trying to log to bugsnag which is causing this error, which is hiding the real error". I confirmed this was my issue by doing what user russianryebread suggested, which was to manually copy the bugsnag.php config file over to the Laravel /config directory. Once I did that now my real error shows:
[Symfony\Component\Debug\Exception\FatalThrowableError] Parse error: syntax error, unexpected '{'
Now to troubleshoot this issue :)
Hope this helps!

Error "Unable parse file browser.yml" when running a test with Magento automation test framework

I have tried to run a test with magento automation framework, but the result shown as "no testcase execute" and error on output shown as
Fatal error: Uncaught exception 'InvalidArgumentException' with message 'Unable to parse file "C:\Users\huongnguyen\mtaf\config\browsers.yml": Unable to parse line 27 (---).' in E:\xampp\php\pear\SymfonyComponents\YAML\sfYaml.php:100
Stack trace:
#0 C:\Users\huongnguyen\mtaf\lib\Mage\Selenium\Helper\File.php(52): sfYaml::load('C:\Users\huongn...')
#1 C:\Users\huongnguyen\mtaf\lib\Mage\Selenium\TestConfiguration.php(387): Mage_Selenium_Helper_File->loadYamlFile('C:\Users\huongn...')
#2 C:\Users\huongnguyen\mtaf\lib\Mage\Selenium\TestConfiguration.php(264): Mage_Selenium_TestConfiguration->_loadConfigData()
#3 C:\Users\huongnguyen\mtaf\lib\Mage\Selenium\TestConfiguration.php(163): Mage_Selenium_TestConfiguration->_initConfig()
#4 C:\Users\huongnguyen\mtaf\lib\Mage\Selenium\TestConfiguration.php(147): Mage_Selenium_TestConfiguration->init()
#5 C:\Users\huongnguyen\mtaf\bootstrap.php(44): Mage_Selenium_TestConfiguration::initInstance()
#6 E:\xampp\php\pear\PHPUnit\Util\Fileloader.php(92): include_once('C:\Users\huongn...')
#7 in E:\xampp\php\pear\SymfonyComponents\YAML\sfYaml.php on line 100
Anyone ever met like before?
I've resolved this by upgrading the Symfony Yaml package to the latest version:
pear channel-discover pear.symfony-project.com
pear install symfony/YAML
Seems that the "---" syntax is supported on v. 1.0.6 (the latest stable at this moment).

Resources