Install, Configure and Test PHP on linux machines

PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. It is a fast, flexible and pragmatic, PHP powers everything from your blog to the most popular websites in the world.

Installing PHP
# yum install php

1. Increasing PHP script memory limit</span>
# vi /etc/php.ini
replace memory_limit = 16M to memory_limit = 128M

2. Increasing PHP script max execution time
# vi /etc/php.ini
replace max_execution_time = 30 to max_execution_time = 120

3. Increasing PHP script max upload size
# vi /etc/php.ini
replace max_upload_size = 2M to max_upload_size = 50M

4. # vi /etc/php.ini
replace post_max_size = 8M to post_max_size = 50M

Additional steps
# mkdir /usr/share/phpinfo
# vi /usr/share/phpinfo/index.php
<?php
phpinfo();
?>

Change permissions on the index.php
# chmod 0755 /usr/share/phpinfo/index.php
# vi /etc/httpd/conf.d/phpinfo.conf
# phpinfo - PHP utility function for displaying php configuration
#
# Allows only localhost by default

Alias /phpinfo /usr/share/phpinfo
<Directory /usr/share/phpinfo/>
order deny,allow
deny from all
allow from 127.0.0.1
</Directory>

Restart Apache Server
# /etc/init.d/httpd restart
# service httpd restart
Testing

On any browser you have installed, point the URL as http://localhost/phpinfo

linux log files, location and description

Linux stores logs of almost everything from user accounting to system halts. These logs are always useful to debug problems or track the loophole of any configurations. Logs are the records of system activity to assure the faults, traffic activities, configuration logs, user activity logs. Main Linux log files are situated at /var/logs by default. While it is also possible to define the log file in a custom path in the configuration files and this is usually not recommended. Major log files in Linux are described below.

/var/log/messages -------->contains standard I/O logs, DNS logs, DHCP, NFS, NIS
/var/log/boot.log  -------->contains boot time logs about system shutdown, reboot
/var/log/dmesg     -------->hardware specific logs
/var/log/xferlog     -------->logs of FTP actities includes uploads, downloads, user processes
/var/log/samba      -------->logs of samba services(windows)
/var/log/httpd/*     -------->logs of all web activities, apache web server
/var/log/secure      -------->logs of SSH, telnet and authentication services
/var/log/cups/*      -------->logs of print activities
/var/log/cron         -------->logs of system activities from cron jobs
/var/log/xorg/*      -------->GUI related logs
/var/log/auth.log    -------->Authentication related logs
/var/log/kern.log   -------->Kernel logs
/var/log/maillog      -------->mail server logs
/var/log/mysqld.log -------->logs from mysql activities
var/log/yum.log      -------->logs of yum activities includes packages downloads

Besides these, log files are created automatically after each package configurations.