Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

How to compile APC module for PHP

Answer:

The following steps works in RHEL/CentOS

1. Download the latest APC from PECL

wget http://pecl.php.net/get/APC

2. Extract the APC source package and compile/install it

tar -xvf APC
cd APC-X.X.X (replace with your downloaded version)
phpize
./configure
make && make install

3. Enable APC in PHP configuration

echo "extension=apc.so" > /etc/php.d/apc.ini

4. Restart the httpd and use phpinfo() to verify if APC is running

How to display the current runlevel in RedHat/Fedora

Answer:

# /sbin/runlevel
N 3

3 is the current runlevel, and N means no previous runlevel

Remove default Fedora/RHEL/CentOS default Apache welcome page

Answer:

To remove the Apache default welcome page under Fedora/RHEL/CentOS,

1. Remove the welcome page configuration

# rm -rf /etc/httpd/conf.d/welcome.conf

2. Restart Apache

# /etc/init.d/httpd restart 

That's all.

How to upgrade an installed RPM package

Answer:

To upgrade an installed RPM package under Red Hat/Fedora/CentOS

# rpm –Uvh package.rpm

Install GD Library for PHP on Linux

Answer:

To install GD Library for PHP on Linux

1. Fedora/CentOS

# yum install php-gd

Then restart Apache

# service httpd restart

2. Debian/Ubuntu

# sudo apt-get install php5-gd

Then restart Apache

# sudo /etc/init.d/apache restart