Skip to content
Advertisement

Php info differs from server and info.php

I donĀ“t know why but when i type on the server php -v i shows:

PHP 7.4.5 (cli) (built: Apr 23 2020 00:10:21) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with the ionCube PHP Loader + ionCube24 v10.4.1, Copyright (c) 2002-2020, by ionCube Ltd.
with Zend OPcache v7.4.5, Copyright (c), by Zend Technologies

But if i create a info.php file and see it on the browser it shows only:

This program makes use of the Zend Scripting Language Engine:
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.5, Copyright (c), by Zend Technologies

As you can see i’m trying to install ioncube extension, if i create an encoded file and execute it from the server directly it works… but if i try to execute the file from the browser it doesn’t. Obviusly is something between php and apache server but cant see the issue.

My info.php shows /etc/php.ini as a ini file, and /etc/php.d as route for additional .ini file, i create a file in /etc/php.d that loads the extension and it works with php on the serve but again not when use it on the browser. Its like it was two php one for the server directly and one for php??.

Another thing is that in Additional .ini files parsed, on the server it shows my file created on /etc/php.d/ but not in the info.php.

Advertisement

Answer

There is a difference between the Command Line Interface (php cli) and the PHP version used by Apache or Nginx through your webserver.

Your first command is ran from the command line, which will give you the PHP-CLI version.

Create a file with phpinfo(); will show you the webserver version.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement