I have installed PHP on my CentOS server. However, when I run phpinfo () inside my script to check it, I get HTML, not the interpreted information.
I see folders for PHP. I even see php.ini in the etc folder, but PHP itself does not seem to work.
I mean my test.php file looks like this:
<?php phpinfo(); ?>
And the answer looks like this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> <html><head> <style type="text/css"> body {background-color: #ffffff; color: #000000;} body, td, th, h1, h2 {font-family: sans-serif;} pre {margin: 0px; font-family: monospace;} a:link {color: #000099; text-decoration: none; background-color: #ffffff;} ...
and so on.
What is the problem and how can I solve it?
If I copy the returned HTML code, paste it into the HTML file and run it from there, I can see the formatted result, but without running test.php. I assume that PHP is not loaded somehow ... even if in the interpreted HTML I see:
**Server API Apache 2.0 Handler Virtual Directory Support disabled Configuration File (php.ini) Path /etc/php.ini Scan this dir for additional .ini files /etc/php.d additional .ini files parsed /etc/php.d/dbase.ini, /etc/php.d/json.ini, /etc/php.d/mysql.ini, /etc/php.d/mysqli.ini, /etc/php.d/pdo.ini, /etc/php.d/pdo_mysql.ini, /etc/php.d/pdo_sqlite.ini PHP API 20041225 PHP Extension 20050922 Zend Extension 220051025 Debug Build no Thread Safety disabled Zend Memory Manager enabled IPv6 Support enabled Registered PHP Streams php, file, http, ftp, compress.bzip2, compress.zlib, https, ftps**
and so on...
This system has three websites. Is this somehow related to this problem?