Reputation: 41
I was following instructions to install get to clone a repository and then all of the sudden I started getting "bin/magento must be run as a CLI application" error.
When I did php -v, it shows:
ea-php-cli Copyright 2016 cPanel, Inc.
PHP 7.0.17 (cgi-fcgi) (built: Apr 5 2017 23:22:19)
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.17, Copyright (c) 1999-2017, by Zend Technologies
I've sincerely searched for hours to change this back to show (cli), but so far no luck.
I've reinstalled ea-php-cli via yum but nothing has changed.
When I stopped and restarted the httpd, I get a bunch of errors like this one:
[alias:warn] [pid 31484] AH00671: The ScriptAlias directive in /etc/apache2/conf/httpd.conf at line 645 will probably never match because it overlaps an earlier ScriptAlias.
Does anyone know the command to change the php mode to cli mode rather than cgi-fcgi mode? If not, do I need to uninstall and reinstall php?
Update
so after some research I realized that it has to do with the Server API where it's set up as FPM/FAstCGI rather than Apache 2.0 Handler. I will have to research this and then find out how to switch the server API back to Apache Handler... I'm running Centos 6.9 so if anyone has an easy solution, I'd greatly appreciate your input.
More Update
The only thing I can think of that may have affected the Server API to switch is a few of the patches I have made. Here's a list of all the patches and changes made to the server today:
Apr 15 12:47:02 Installed: kernel-2.6.32-696.1.1.el6.x86_64
Apr 15 13:14:02 Installed: 1:perl-Error-0.17015-4.el6.noarch
Apr 15 13:14:02 Installed: perl-Git-1.7.1-8.el6.noarch
Apr 15 13:14:03 Installed: git-1.7.1-8.el6.x86_64
Apr 15 19:21:49 Erased: epel-release
Apr 15 20:33:45 Installed: ea-php-cli-0.2.0-1.1.1.cpanel.x86_64
Apr 15 21:00:58 Installed: ea-php-cli-0.2.0-1.1.1.cpanel.x86_64
Apr 15 22:32:44 Installed: ea-php-cli-0.2.0-1.1.1.cpanel.x86_64
Upvotes: 3
Views: 2083
Reputation: 41
After 15 hours of searching for an answer, I finally got it resolved.
Simply add source /opt/cpanel/ea-php70/enable to /etc/bashrc and php -v results in showing cli.
PHP 7.0.17 (cli) (built: Apr 5 2017 23:21:59) ( NTS ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies with Zend OPcache v7.0.17, Copyright (c) 1999-2017, by Zend Technologies
Upvotes: 1