Switch from PHP-CGI-FGI to PHP-CLI

Operating System & Version
centos 7

elounajj

Registered
Dec 22, 2020
4
0
1
France
cPanel Access Level
Root Administrator
Hello, so basically, I had php-cli installed on my server.
When I Was running the command php-v there was the output

PHP 7.3.25 (cli) (built: Dec 9 2020 03:04:08) ( NTS )
Copyright (c) 1997-2018 The PHP Group

But after installing cPanel there is the new output

PHP 7.3.25 (cgi-fcgi) (built: Dec 9 2020 03:04:52)
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.25, Copyright (c) 1998-2018 Zend Technologies

How do I get back to
PHP 7.3.25 (cli) (built: Dec 9 2020 03:04:08) ( NTS )

Thank you
 
Last edited by a moderator:

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
6,974
921
313
cPanel Access Level
Root Administrator
Hey there! I don't believe there's going to be a way to do that as cPanel always processes PHP with the handler assigned to that version. It's also worth mentioning that cPanel should not be installed on anything but a brand new machine, so there should not be an existing PHP version before cPanel is installed.
 

elounajj

Registered
Dec 22, 2020
4
0
1
France
cPanel Access Level
Root Administrator
I tried both either installing php before or installing php after. It is still the same thing. It is not working the way you are talking about. I have been trying what you are talking about and when I try to run a php script using the command php -r on php-cgi-fgi it says -r is not a valid parameter
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
6,974
921
313
cPanel Access Level
Root Administrator
It seems there is an issue with the PHP configuration on the system, as that would normally find the binary located in /usr/local/bin/php. I would not expect either configuration you mentioned to work properly, as cPanel installs PHP for you so you don't need to manually install software after the cPanel installation has completed.

If you have a brand new server and then install cPanel it will include PHP by default, and then you can add other versions through EasyApache, but there won't be a way to make it look like your non-cPanel system.