Tuesday, November 15, 2011

How to create a php info page

Go to the DocumentRoot of your domain or default DocumentRoot of your webserver.

Create a php info file as follows.
[root@server1 public_html]# cat info.php

<?php
// Show all information, defaults to INFO_ALL
phpinfo();
?>
[root@server1 public_html]#

Give proper permissions
permission 644
ownership as domain owners

Now go to the browser and access as given below:
http://your_domain/info.php
or

How to enable php json on centos


We can enable php json using pecl. This can be used in directadmin servers also.

First we have to find the location of perl command. Using the following command.
[root@server1 /]# which pecl
/usr/local/bin/pecl

Now installing json using pecl
[root@server1 /]# /usr/local/bin/pecl install json

Testing the module
[root@server1 /]# php -ini | grep json
json
json support => enabled
json version => 1.2.1
[root@server1 /]#