Difference between revisions of "Php"

From vpsget wiki
Jump to: navigation, search
Line 16: Line 16:
 
Now you can display php details using url http://YourIP/phpinfo.php
 
Now you can display php details using url http://YourIP/phpinfo.php
  
If you want to recompile php you can copy your current php settings under "Configure Command" in http://YourIP/phpinfo.php, for example:
+
If you want to recompile php you can copy your current php settings under "Configure Command" in http://YourIP/phpinfo.php
'./configure' '--with-apxs2=/usr/bin/apxs2' '--with-mysql=/usr' '--with-mysqli=/usr/bin/mysql_config' '--with-pgsql=/usr' '--with-tidy=/usr' '--with-curl=/usr/bin' '--with-curlwrappers' '--with-openssl-dir=/usr'  '--with-xpm-dir=/usr' '--with-pdo-pgsql=/usr' '--with-pdo-mysql=/usr' '--with-xsl=/usr' '--with-ldap' '--with-xmlrpc' '--with-iconv-dir=/usr' '--with-snmp=/usr' '--enable-exif' '--enable-calendar' '--with-bz2=/usr' '--with-gd' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--with-zlib-dir=/usr' '--with-freetype-dir=/usr' '--enable-zip' '--with-pear
+
 
 +
Download source of your current php version, cd to the extracted folder and execute:
 +
./configure --with-apxs2=/usr/bin/apxs2 --with-mysql=/usr --with-mysqli=/usr/bin/mysql_config --with-pgsql=/usr --with-tidy=/usr --with-curl=/usr/bin --with-curlwrappers --with-openssl-dir=/usr --with-xpm-dir=/usr --with-pdo-pgsql=/usr --with-pdo-mysql=/usr --with-xsl=/usr --with-ldap --with-xmlrpc --with-iconv-dir=/usr --with-snmp=/usr --enable-exif --enable-calendar --with-bz2=/usr --with-gd --with-jpeg-dir=/usr --with-png-dir=/usr --with-zlib-dir=/usr --with-freetype-dir=/usr --enable-zip --with-pear
 +
 +
 
 
[[Category:Linux]]
 
[[Category:Linux]]

Revision as of 15:56, 6 November 2013

To install php on Centos enter following command:

yum install php

To install php-mysql:

yum install php-mysql

Locate working php.ini:

php -i | grep 'Configuration File'

Create file phpinfo.php in web accessible directory, for example /var/www/html:

nano /var/www/html/phpinfo.php

Add following to the file and save it:

<?php

// Show all information, defaults to INFO_ALL
phpinfo();

?>

Now you can display php details using url http://YourIP/phpinfo.php

If you want to recompile php you can copy your current php settings under "Configure Command" in http://YourIP/phpinfo.php

Download source of your current php version, cd to the extracted folder and execute: ./configure --with-apxs2=/usr/bin/apxs2 --with-mysql=/usr --with-mysqli=/usr/bin/mysql_config --with-pgsql=/usr --with-tidy=/usr --with-curl=/usr/bin --with-curlwrappers --with-openssl-dir=/usr --with-xpm-dir=/usr --with-pdo-pgsql=/usr --with-pdo-mysql=/usr --with-xsl=/usr --with-ldap --with-xmlrpc --with-iconv-dir=/usr --with-snmp=/usr --enable-exif --enable-calendar --with-bz2=/usr --with-gd --with-jpeg-dir=/usr --with-png-dir=/usr --with-zlib-dir=/usr --with-freetype-dir=/usr --enable-zip --with-pear