Sometimes we install or develop Php+mysql+apache applications that require a version of the environment, and we can use the following code to query PHP, MYSQL, and Apache versions of the information to see if they meet our needs.
1. Direct access to PHP version
<?php
Echo ' PHP version: '. Phpversion ();
?>
2. Get MySQL version directly
<?php
mysql_connect (' 127.0.0.1 ', ' root ', ');
Echo ' MySQL version: '. Mysql_get_server_info ();
?>
3. Get Apache Version
<?php
Echo ' Apache version: '. Apache_get_version ();
?>
If we want to query more detailed PHP configuration, we can use the following sentence code directly:
<?php
Phpinfo ();
?>
Linux,apache,php,mysql Common way to view version information
1. View Linux kernel version , System information, commonly used in three ways:
Uname-a; More/etc/issue; Cat/proc/version;
2. View Apache version information , if it is through Yum, or RPM installed, you can use Rpm-qa |gerp httpd to view;
Can also be queried by httpd-v;
Of course, after the installation of Apache, you can directly elink the loop to view Apache information.
3. View PHP Version Information , if it is through Yum, or RPM package installed, you can use Rpm-qa |grep php to view;
Also, you can use Php-v to view the version information of PHP;
Generally, after installing lamp, use Phpinfo's test page to view the installed PHP information;
The concrete method is to/var/www/under the new index.php file, the concrete content namely
PHP phpinfo ();
?>
Can. You can then add the index.php type to the/etc/httpd/conf/httpd.conf file and restart the httpd to get the following results.
4. View MySQL version information , if it is installed through the Yum, or RPM package installed, you can use Rpm-qa |grep mysql to view;
You can also use Mysql-v or--help|grep distrib to view it.
You can also access MySQL, and then select Version () by command, to view;
or the Status command view.
Personally think these are more commonly used methods, of course, there will certainly be more effective, more convenient ways and means.