Create a .php file
# vi showip.php
<h1>My Ip Address</h1><hr> <br><br> Your Ip Address is: <strong><?php echo $_SERVER[‘REMOTE_ADDR’]; ?></strong><br><br>
Close the file and done
RESULT
http://admin2.mweb.com.na/showip.php
Create a .php file
# vi showip.php
<h1>My Ip Address</h1><hr> <br><br> Your Ip Address is: <strong><?php echo $_SERVER[‘REMOTE_ADDR’]; ?></strong><br><br>
Close the file and done
RESULT
http://admin2.mweb.com.na/showip.php
You can tell apache to treat your .html pages as .php pages by adding the following line of code to your .htaccess file:
AddHandler application/x-httpd-php5 .php .htm .html
The above code will parse your .html pages using php5, if you would like to use php4 instead, please use the line of code below:
AddHandler application/x-httpd-php4 .php .htm .html
The following are the steps to install CentOS 5.5+
1. Download the source from the following Url using the command:
#wget https://xsdou.googlecode.com/files/zpanel-6.1.1.tar.gz
2. Create a directory as below:
#mkdir /etc/zpanel
3. Extract the source to /etc/zpanel:
#tar -zxvf zpanel-6.1.1.tar.gz -C /etc/zpanel/
4. Change mod using the following command:
#chmod +x /etc/zpanel/lib/dev/zpinstall_centos.sh
5. Finally, run the following command and follow the screen instructions.
#/etc/zpanel/lib/dev/zpinstall_centos.sh
This will download and install all the required dependencies (Apache, PHP, Postfix etc.) as well as setup and install the entire environment.
On my redhat based server, I installed the PHP mbstring extension as:
Connect the repository:
wget -q -O – http://www.atomicorp.com/installers/atomic.sh | sh
yum –enablerepo=webtatic install php-mbstring
/etc/init.d/httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
Reason why it happen:
php5-suhosin depends on an obsolete version of phpapi-20090626+lfs
so php5-suhosin is removed during the upgrade… but the PHP config
snippet /etc/php5/conf.d/suhosin.ini isn’t purged… so PHP still
try to load the module suhosin.so.
to fix this
STEP 1
Connect the repository:
wget -q -O – http://www.atomicorp.com/installers/atomic.sh | sh
STEP 2
yum –enablerepo=webtatic install php-suho*
that’s it
restart http
sample output
Dependencies Resolved
==================================================================================================================================================
Package Arch Version Repository Size
==================================================================================================================================================
Installing:
php-suhosin i386 0.9.32.1-1.w5 webtatic 79 k
Transaction Summary
==================================================================================================================================================
Install 1 Package(s)
Upgrade 0 Package(s)
Total download size: 79 k
Is this ok [y/N]: y
Downloading Packages:
php-suhosin-0.9.32.1-1.w5.i386.rpm | 79 kB 00:01
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : php-suhosin 1/1
warning: /etc/php.d/suhosin.ini created as /etc/php.d/suhosin.ini.rpmnew
Installed:
php-suhosin.i386 0:0.9.32.1-1.w5