Installing Magento 2 Extensions : Troubleshooting
Contents
- 1 Magento Help
- 1.1 "After install I get 'Fatal error: Uncaught Error: Call to a member function getNext() on null in Interceptor.php'"
- 1.2 "After install I get a '500 Internal Server Error' in the browser"
- 1.3 "After install I get a fatal error, with 'Unable to retrieve deployment version of static files from the file system' in the reports"
- 1.4 "When entering the license key, it spins and doesn't save"
- 1.5 "After install I get images missing, or a server error: 'Forbidden: PHP is disable.'"
- 1.6 "I see an unstyled admin page"
- 2 pickPack (M2):
- 3 shipEasy (M2):
- 4 "I still have issues"
- 5 "I stilll have issues!"
Magento Help
Something unexpected happened?
Try not to worry too much, take a deep breath and read through these common issues and solutions below.
Most issues have been seen before and are quickly fixable or at least revertible-from.
"After install I get 'Fatal error: Uncaught Error: Call to a member function getNext() on null in Interceptor.php'"
Check that you've run setup:di:compile, eg. from Magento root:
php bin/magento setup:di:compile
"After install I get a '500 Internal Server Error' in the browser"
- Check your server error logs first, as this is what it says on the tin : a server error.
- Where this is will depend on your server. Here's some common examples:
- Centos: {server root}/var/log/httpd/
- Debian, Ubuntu: {server root}/var/log/apache2/
- MAMP: {Applications}/MAMP/logs/php_error.log apache_error.log
- MageMojo: /home/log/apache/error.log
- Access eg. via
nano /var/log/httpd/apache_error.log
- If the error isn't apparent in those logs, you might not have deployed static content since the update:
- Move pub/static/.htaccess somewhere out of that folder
- Delete /pub/static :
rm -R pub/static
- Run
php bin/magento setup:static-content:deploy
- Replace .htaccess in pub/static
- Or in one line:
mv pub/static/.htaccess pub/.htaccess
rm -R pub/static
php bin/magento setup:static-content:deploy
mv pub/.htaccess pub/static/.htaccess
- If that didn't help, you might have some old composer files causing issues.
- Delete /vendor :
rm -R vendor
- Run
composer update
- Delete /vendor :
"After install I get a fatal error, with 'Unable to retrieve deployment version of static files from the file system' in the reports"
Try running:
php bin/magento setup:static-content:deploy
"When entering the license key, it spins and doesn't save"
- Check that you have the openssl_public_encrypt PHP function enabled on your server
- Some dev servers have this off by default
- Also check the system logs in var/logs
- Finally check your server log files to see what's happening
If those don't resolve the issue, get in touch and we'll check it out.
"After install I get images missing, or a server error: 'Forbidden: PHP is disable.'"
- Open /pub/static/.htaccess
- Prefix the middle lines here with a # (to comment them out):
<IfModule mod_php5.c>
php_flag engine 0
</IfModule&dt;
<IfModule mod_php7.c>
php_flag engine 0
</IfModule&dt;
- So they look like this:
<IfModule mod_php5.c>
#php_flag engine 0
</IfModule&dt;
<IfModule mod_php7.c>
#php_flag engine 0
</IfModule&dt;
- Also check the correct magento file permissions are set
"I see an unstyled admin page"
Seeing some plainer-than-usual displays?
You might have some older static content that needs re-creating.
Try:
php bin/magento setup:static-content:deploy -f
pickPack (M2):
"After install I get a 'Unknown module(s): 'Moogento_PickPack' error"
If you've just ran:
php bin/magento module:enable Moogento_PickPack
and get that error message, then there's a few things to check:
- Have you uploaded pickPack files to the repo? :)
- Have you gone through our Install Guide?
"The admin user is logged out when trying to print PDFs."
This is a Magento issue, related to Github magento2: Issue #5309
Other users have suggested editing the .htaccess or conf file to something like this:
php_value session.cookie_lifetime 86400
php_value session.gc_maxlifetime 86400
and then setting the Admin Session timeout to 86400 in the admin config..
"I see text links instead of nice images!"
Have you recently cleared /pub/static ?
You're likely missing the /pub/static/.htaccess file. Just copy that back in (from another install if necessary).
"When compiling a plugin, I get: 'Class 'PHPUnit\Framework\TestCase' not found in ... mPDFTest.php'."
See this issue explained & resolved for one case here.
tldr;
Are you running Magento < 2.2 ?
Yes! Get in touch, you're a special case :)
No? Read on!
• You need PHPUnit version at least 6.x
• Install that via composer
Installing PHPunit
Try running composer install
and/or removing /vendor folder.
If you decide to remove that folder then you might use this command, inside your Magento root folder:
rm -rf vendor/*
And then get composer to reinstall those modules:
composer update
php bin/magento setup:upgrade
Recompile:
php bin/magento setup:di:compile
If you still have issues, check that your version is correct:
composer show -- phpunit/phpunit
If that's still showing a version less than 6.5, try going into the Moogento_Core and running update:
cd app/code/Moogento/Core
composer update
Also check, if you're running different PHP versions (eg. on local maybe using MAMP and a central PHP version) that you can access phpunit:
phpunit --version
^ If this returns an error then probably the easiest thing to do is install phpUnit:
wget https://phar.phpunit.de/phpunit-6.5.phar
chmod +x phpunit-6.5.phar
sudo mv phpunit-6.5.phar /usr/local/bin/phpunit
And then check again:
phpunit --version
If you're running Magento locally, using something like MAMP:
1. Copy phpunit into /MAMP/bin/
2. Edit the bash profile:
nano ~/.bash_profile
then add this after other PATH lines:
export PATH=/Applications/MAMP/bin/php/php7.1.12/bin:$PATH
shipEasy (M2):
"When installing, after running compile on production, I get an error 'The directory /var/generation cannot be deleted'"
Re-generate static content:
php bin/magento setup:static-content:deploy
- If your store isn't in English try this, in this order (eg. here for a French store):
php bin/magento setup:static-content:deploy en_US fr_FR
"After install I see a spinning wheel in the Orders page which doesn't go away"
Your install may not have completed correctly.
- Try re-running the installation compile commands.
- Check that your file & folder permissions are correct:
- The Magento file system user should have full control (read/write/execute) of all files and directories
- That user must not be the same user as the web server user
- The web server user must have write access to these files and folders:
- /var app/etc
- /pub
- /generated (since 2.2.1)
- The web server user group must own the Magento file system so the Magento user (who's in that group) can share file access with the web server user.
- (Including files created by the Magento Admin or other web-based utilities)
cd {root Magento folder}
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
find ./var -type d -exec chmod 777 {} \;
find ./pub/media -type d -exec chmod 777 {} \;
find ./pub/static -type d -exec chmod 777 {} \;
chmod 777 ./app/etc
chmod 644 ./app/etc/*.xml
chown -R :{web server group} .
chmod u+x bin/magento
- Then clear the caches:
php bin/magento cache:clean && php bin/magento cache:flush && php bin/magento cache:enable
"I still have issues"
Check you're using a supported version of PHP & Magento
- Check which version of PHP your version of Magento supports
- If you're not running a supported version, pause the install and consider changing your installed PHP version
- Open up {plugin}/composer.json and check the PHP & Magento versions that are supported match what you're running
Check log files
Your Magento 2 debug log file should be located here:
- var/log/debug.log
If you haven't turned on logging do so now.
Enabling debug logging
Via Admin backend
- Stores -> ConfigAdvanced -> Developer Debug -> "Log to File"
Via CLI
php bin/magento config:set dev/debug/debug_logging 1 && php bin/magento cache:flush
- If you get a --lock error then try this:
php bin/magento config:set --lock dev/debug/debug_logging 1 && php bin/magento cache:flush
Disabling debug logging
php bin/magento config:set dev/debug/debug_logging 0 && php bin/magento cache:flush
- Try running Magento and then check those log files - the default location is /var/log
- Add a number to the log filenames to see recent messages only.
- Next, check your server log files for errors (location will depend on your server - look for php and server log files).
Check file ownership permissions
If you didn't get this done when setting up Magento, or installed the plugin under a server user that's not the one that owns the Magento files, you might need to check this.
Check Magento 2 File Ownership and Permissions
Disabling extensions
Still problems? Let's turn it off:
- Disable the extension :
php bin/magento module:disable Moogento_PickPack --clear-static-content
- Disable other Moogento code if you like:
php bin/magento module:disable Moogento_License --clear-static-content
php bin/magento module:disable Moogento_Core --clear-static-content
- ^ Don't do this step if you want to leave other Moogento plugins running!
- Recompile:
php bin/magento setup:di:compile
- Update the db:
php bin/magento setup:upgrade
- Clear caches:
php bin/magento cache:clean && php bin/magento cache:flush
Removing extensions
Need to remove all files related to our plugins?
Don't forget to drop us a line if something is going wrong, as we can usually help :)
Via CLI:
- Disable the plugins first, as per above
- Navigate to the Moogento parent folder:
cd /app/code/Moogento/
- Check what's there:
ls
- Remove the plugin folder:
rm -rf {extension name: eg. PickPack}
- Clear cache and indexes and log out/in
Via FTP:
- Disable the plugins first, as per above
- Download the latest version you have access to from your account
- Compare those files and folder structure with what you have installed
- Remove those files, starting with /app/code/Moogento/{plugin name}
- Clear cache and indexes and log out/in
"How long will it take to investigate and fix my issue?"
If you've got in touch with a issue or custom work request, we'll get back to you with a rough ETA.
We do all work in the order that they come in, with some sorting based on the Maintenance Plan you're on.
We can't begin the work (or the ETA timer) until we have correct access details, so please make sure you send correct ones.
"Why is my issue resolution ETA not Right Now???!!!"
Estimates for development work are necessarily vague, it may be faster or slower than the ETA we send you.
It takes time to properly investigate bug reports, and plan feature requests, and we're a small team - we go as fast as we can but please don't expect magical instant development work :)
Also worth bearing in mind that we respond to support requests ourselves, so if you email every day for an update then you'll be directly slowing down your issue resolution.
"I found some encrypted portions of code, have I been hacked?"
All our code is open for you to edit.
We do have a couple of small blocks of encrypted code which are part of our licensing system. These need to be left unedited for your extension to work.
If you're worried that you've been hacked and have some unauthorised code, the easiest way to check these specific files is to compare that code with the same file from the extension zip, downloaded from your Moogento account. Note that this code will sometimes change between versions, so make sure you're comparing the same version.
"I stilll have issues!"
- Drop us a line with:
- your (S)FTP & SSH access details
- Magento admin access
- which version of Magento
- which PHP version
- which Moogento plugin & version
- Before getting in touch, please:
- turn on Magento logging,
- turn off Magento compilation,
- provide details of any opcode or db cache systems and their logins,
- provide the path to your server log files
- include your order id or license key
"How do I give you Magento access?"
Tried all the suggestions above and need us to take a look? Not sure how to do that?
- Log into your Magento site
- Copy the URL from the browser and add it to your email to us.
- Next go to SystemPermissionsUsers > Add New User
- Make a username and password and add that to the email to us.
- then click User Role in the left column and assign us the role of Administrator.
Done!
"Where do I find the license key?"
We need your order id or license key before we can help with support. Because, you know. :)
- Go to SystemConfigurationMoogento -> (the extension you want help with, eg. pickPack)
- Click the 'License' section at the top of the page to expand it.
- Copy the value from the 'License Key' field.
- Paste that in your email that to us.