Difference between revisions of "Php"
Line 3: | Line 3: | ||
To install php-mysql: | To install php-mysql: | ||
yum install php-mysql | yum install php-mysql | ||
− | "[[Category:Linux]] | + | 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, for example: | ||
+ | './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]] |
Revision as of 15:51, 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, for example:
'./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