PHP cli not working with local path (suddenly)
Asked Answered
M

2

9

From a couple of hours, PHP commands, given from the console, are not accepting local path. For example in laravel i've always given the command

php artisan

but from this night i'm receiving the following reply

Status: 404 Not Found
Content-type: text/html; charset=UTF-8

No input file specified

but if i try php ./artisan, it's working.

The server is configured with WHM/cPanel and, the strangest thing, is that nothing has been changed, and yesterday everything was working correctly. Also the row with the Content-type was not appearing before today.

Molokai answered 24/8, 2016 at 9:38 Comment(5)
It seems there was an upgrade of the PHP interpreter and the CGI version is mistakenly used now as CLI too. The CLI doesn't produce headers, only the versions designed to work with a web server and generate web pages do. Contact your hosting provider.Samantha
@Samantha thanks for your reply. The server is managed from me, it's a dedicated machine from OVH but I never encountered this type of error and I really don't know how can I solve this. Do you have any ideas?Molokai
As I said, the CLI version of PHP doesn't generate headers. Did you upgrade PHP just before the strange behaviour started? Depending on the Linux flavor you use, it's possible that the CLI version of PHP to be named php-cli. Or maybe you modified your $PATH and the path of the CGI version comes before the on of the CLI?Samantha
me too had the same exact problem today, except for that php ./artisan gives another error message and still not working.Knuth
@AhmadTawila watch my reply below, there is the solutionMolokai
M
5

Here I have the response (with the solution) from cPanel team that solved this problem a few hours ago.

Thanks for your patience while I corrected this issue. This was occurring due to an update in the ea-php-cli package which occurred last night which conflicted with another case EA-4753 in which the include_path was set incorrectly and the issue wasn't visible until the update of ea-php-cli last night.

I've corrected your issue and have filed case EA-5106 so that our developers ensure that EA4 doesn't allow for this to occur again. The current workaround is to go to Home »Software »Editor INI MultiPHP, select the version of php, scroll down to include_path and then added .:/path/to/php/pear as opposed to .;/path/to/php/pear which has corrected your issue.

EDIT: We also made a downgrade of the package ea-php-cli because in this version there are multiple problems (for example when you do a 'php artisan' (or any other php file) command, it prints the headers), so the command is:

====
yum downgrade ea-php-cli-0.0.6-3.3.1
====

And is possible to lock the package, to prevent it updates automatically before a 'stable' version is released.

====
yum versionlock add ea-php-cli
====

Note that you will need to remove the versionlock once a corrected version has been released:

====
yum versionlock delete ea-php-cli
yum upgrade ea-php-cli
====
Molokai answered 24/8, 2016 at 18:55 Comment(0)
G
3

my rep is too low to up vote or comment, but i'm having this issue now it seemed to start around the same time as you and I also use a dedicated server from OVH.

Garibaldi answered 24/8, 2016 at 15:21 Comment(2)
I'm actually in contact with cPanel support. As soon as I have some news I will publish them here. It seems to be a problem of EasyApache4Molokai
Excellent, I have a server management subscription with Syslint. I've support a ticket and they are usually pretty quick so I'll post any updates I get as well.Garibaldi

© 2022 - 2024 — McMap. All rights reserved.