If your n98-magerun is not working as you were told, don’t go running to Magerun just yet. It might not be magerun at all. It might be the fact that magerun sits inside a phar file. It might be the fact that you cannot execute phar files as you’d expect.
So how do you fix this problem?
First thing’s first: check the PHP error logs. Do you see anything? If so, google the error and see if a result exists. Sometimes it could be bad code. Sometimes it’s an access issue. Either way, get it fixed. Magerun has solutions to these problems on it’s documentation.
What if there are no PHP errors in the logs? Let’s check the user logs instead. fly over to
/var/log/user.log and see if anything shows up there. If so, what is the error? Is it some sort of cryptic error, that has such words as “Attacker” and “Not Allowed”? You might have run into the Suhosin patch.
First, are you running on Debian? If so, Debian installs PHP with the Suhosin patch. Suhosin is an advanced PHP security patch. One of the things that Suhosin does is disable phar file execution by default. If this happens, you need to add an exception to the phar file execution for php.
Create or edit the following file:
Add the following line:
Once that’s done, you should be able to execute Magerun as normal.
I hope this helps!