I just deployed using Envoyer and there were no errors. However, I don't see the new version of the site in my browser.
I SFTP'd into the server, and sure enough the new files are there.
I SSH'd into the current directory and ran php artisan cache:clear but it didn't make a difference; I still see the old version of the site.
I've done tons of deployments and never encountered this before. How do I fix this?
Just adding here. I ran into the same issue after changing the PHP version on the site inside of Forge. My server now has multiple versions of PHP on it. I had to go to the site inside of Envoyer, then go to the server, then updated the PHP version to the new PHP version of the site. Now, FPM will reload the proper PHP version.
From the symptoms you've listed, it sounds like OPcache is enabled.
Restart PHP with the following command:
sudo service phpX.X-fpm reload
Where X.X is the version of PHP you're using.
I was running into this as well, and solved it with the following steps
Go to "Servers" tab in Envoyer
Click "Update Server" icon
Enable "Reload FPM After Deployments"
Related
Using Laravel with DDEV/Docker on a Mac, I am stuck getting PhpStorm to run directly PHPUnit with coverage. I am following these instructions: https://ddev.readthedocs.io/en/stable/users/topics/phpstorm/
I started the setup with
curl -s "https://laravel.build/myproject?with=mysql,redis,memcached" | bash
Everything's is working fine, including debugging with Xdebug after I turned on Xdebug with
ddev xdebug on
PHPUnit works fine via console as well:
ddev exec phpunit
Composer version is 2.1.4.
Following the instructions named above, I am stuck at point 6.
What am I missing out? PHPUnit is located within the directory and it is composer-installed as well:
With composer version 2.2 the phpunit executable in vendor/bin is not a symlink anymore. It‘s a PHP file which includes the original executable with help of stream-wrapper, but including phpunit is not allowed: https://github.com/sebastianbergmann/phpunit/issues/4096#issuecomment-585900398
The bug is solved in composer:
https://github.com/composer/composer/issues/10387#issuecomment-1000246631
Use the following to get the latest dev version until this fix was official released:
composer self-update --snapshot
Further you can configure PhpStorm to use the original file instead:
vendor/phpunit/phpunit/phpunit
Thanks to all of you guys, I really appreciate your help.
Here is how I solved it:
I installed ddev-edge to avoid composer 2.1.x. I could not change it to 2.2 in config.yaml without failing ddev to restart when using stable version of ddev. It only worked on an active docker instance.
Then configurated ddev to use latest PHP-version 8.1 (for a new project from scratch, it makes sense anyway).
Then the error with PHPUnit changed to an error telling me that the PHP version is too old for the PHPUnit version. That was because PHPStorm automatically picked PHP 7.4 as default when connecting to Docker and checking the CLI remote interpreter.
So I changed the PHP executable from "php" to "php8.1"
See screenshots.
Now running PHPUnit from PHPStorm works fine, even with coverage.
Using Moc OS
I was using XAMPP 7.0.27 and
Now updated to XAMPP 7.2.28
After Upgrading not able to open PhpMyAdmin Page using
http://localhost/phpmyadmin/
Getting Following Error on Page
PHP 7.1.3+ is required.
Currently installed version is: 7.0.27
What Should be done to open phpMyAdmin ?
It seems something didn't get upgraded properly or there's a conflict, because XAMPP 7.2.28 should come with PHP version 7.2.28.
Have you some other PHP installation, perhaps you at one time tried to install your own PHP outside of XAMPP? I suggest removing any other installations to as to avoid conflicts. Your MacOS probably comes with PHP, which could be the conflict.
You could start with the XAMPP control panel to verify which is installed, which PHP is being used by XAMPP, and checking that everything is working together. The installer should have put all the pieces in the right places, so if after all that it still isn't working, I suggest reinstalling XAMPP.
My client is running Laravel 5.2 and PHP version 5.6 (all obviously several years old).
I tried to clone the git into Valet with relative success in that the application ran but a bunch of pages threw errors which I am certain is due to me running the latest version of PHP.
So, my question is it better to directly clone the project on Homestead?
Does Homestead offer a more "native environment" for a situation like I am in?
you should try to use an environment that is the closest possible to production.
If your customer uses apache, try xampp. Else adapt to his environment and PHP version, so you can concentrate on code production instead of keep the solution working on more than one environment.
One year later, I came across with the exact same problem; php 5.6.31 and Laravel 5.2.
I managed to simulate the environment with homestead 6, following these steps:
copy the project files to a new folder
Unzip php 5.6 to my local pc (remove php7)
run: composer update (must run with php 5.6 on local pc)
run: composer require laravel/homestead:~6.6.0
run: vendor\\bin\\homestead make
edit Homestead.yml as needed (.ssh path, add php: "5.6" one line below the site sync)
run: vagrant up
run: vagrant ssh
make appropriate changes (google them) according to problems faced on homestead.test (edit xdebug for 502 BAD GATEWAY, edit my.cnf for adding utf8, etc)
Class 'ZipArchive' not found in /home/rm4r8egx5aq4/readyformove.in/application/libraries/PHPExcel/Reader/Excel2007.php
Check php zip extension is missing in your server or not.
If yes,
Run the following commands in Linux Server.
sudo apt-get install php5.6-zip
sudo service apache2 restart
change php5.6-zip depend on your current PHP version.
If it's Shared hosting, these links may help you.
https://in.godaddy.com/community/GoDaddy-Web-Hosting/PHP-Zip-Module/td-p/60228
https://in.godaddy.com/community/VPS-Dedicated-Servers/Error-when-installing-AbanteCart-for-eCommerce-site/m-p/2797#M121
https://www.youtube.com/watch?v=44PsYaM94K4
Login to cPanel.
Locate Select PHP version and click on it.
Choose your desired PHP version and click on Set as Current.
To set the PHP extensions, Click on Switch to PHP settings.
Click on the extension you wish to change, enter the value and save the settings.
Short version
I'm getting this error, when I run php artisan serve and visit my home page:
ReflectionException (-1)
Class setEventDispatcher does not exist
Details
Laravel version: 5.6.39
Environment: local
OS: macOS Mojave 10.14.2
It started, when I got an error using npm (in another project), so I reinstalled Node (this way).
After doing that, then this project (in question) couldn't be started. I was getting this error, when running php artisan serve:
dyld: Library not loaded: /usr/local/lib/libpng16.16.dylib with anything php related
Referenced from: /usr/local/bin/php
Reason: image not found
That error was resolved by updating and upgrading brew.
Then I was capable of starting the project (php artisan serve). But when I visit the home page, this error was shown:
ReflectionException (-1)
Class setEventDispatcher does not exist
If I follow the stack trace, then I can see that it was this line (from my homeController) that triggered the error:
if( ! Auth::check() ){
return view( 'pages.home' );
}
If I commented that out, then the same error occured from another place, where the Auth-module was being used.
Here's the stack trace:
Does anyone know how to resolve this? I can't find any promising results on Google, - and I have no idea why this happens... :-/
Addition1
I tried composer clear-cache and deleting the vendor-folder, and then doing a composer install and the problem still occured.
I also checked my Service Providers, as Marcus suggested, - but I don't really know what to look for in there. It all looks pretty regular (no fancy if-statements or anything).
Addition2
I realized, that I couldn't connect to my database using Sequel Pro. And it was because Brew had updated my MySQL-version from 5.5 to 8.0.
That was resolved by doing something along these lines (I did a bunch of stuff, so I might be missing a coulple of steps):
brew unlink mysql
brew install mysql#5.7
brew switch mysql 5.7.21
brew link mysql
and I could then verify the version with mysql --version. I also had some permission issues with that MySQL-version-change, but I'm emitting that, so this doesn't get too long.
Addition3
I tried disabling the Laravel Debugbar (by deleting it from composer.json, deleting composer.lock and vendor and then running composer install). And that fixed it!! ... But!
When I later tried to install Barryvdh's IDE Helper, then the exact same error came back!?
I performed these three steps, to install the IDE Helper (and re-introduce the error):
Run this command from the root of my directory: curl https://gist.githubusercontent.com/barryvdh/5227822/raw/4be028a27c4ec782965bb8f2fdcb4c08c71a441d/_ide_helper.php -o _ide_helper.php
Add these lines to app/Provider/AppServiceProvider.php:
...
if ($this->app->environment() !== 'production') {
$this->app->register(\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class);
}
Run this command: composer require --dev barryvdh/laravel-ide-helper
So I'm back at this error:
ReflectionException (-1)
Class setEventDispatcher does not exist
... The stack trace is identical to the one shown previously (sprung from Container.php).
Tried every solution, none of them worked.
Finally, i realised that when trying to upgrade php to 7.3.3 it was infact a network error that caused the fail. Read the logs, tried again, restarted valet and tried again.
It works now.
Upgrading to 7.3.3 was the solution indeed.
Thank you!
So this is what usually fixes it for me
Reinstall composer dependencies by removing vendor folder and composer.lock. Then run composer clear-cache and then composer install (this is usually the problem)
Check that all service providers are imported correctly in app.php under directory config
Make sure that your service providers are not importing something that does not exist, for example if you register a service provider in production but is only installed as dev:
if (env('APP_DEBUG')) {
$app->register(Barryvdh\Debugbar\LumenServiceProvider::class);
}
If you use valet, I solved it running
valet restart and all works fine.
cheers!
The fix for me was to update PHP to 7.3.3 and then restart valet. Apparently this was a bug with php 7.3
https://github.com/laravel/framework/issues/27052
Hope this helps
I got some idea... I've just run into this problem after reconfiguring my apache virtual host ports, so I restarted apache/httpd again, and the problem went away. Might it be related with the server environment?
I am facing the same issue in mac book pro. My system configuration is PHP 7.3, MySQl and I use SQL Pro. I have implemented all the above methods but nothing gets worked.
The issue is still a mystery for me but for temporary I have solved this issue using
artisan command as bellow.
php artisan serve
Its Allow me to run the project on http://localhost:8000
Hope this can help to solve this issue.
Try to restart PHP. When I reboot my Mac, then this happens. After restarting PHP everything starts to work.
sudo brew services restart nginx