www.linuxexpert.ro

Tutorials

  • Home
  • BGP Tutorials
    • Remove private AS
  • cPanel Tutorials
    • Install ImageMagick on cPanel
    • Install Softaculous
  • Linux Tutorials
    • Auto-reboot Linux after kernel panic
    • Building a firewall with Iptables
    • Change array RAID 1 disk order
    • Configure ntfs-3g on Linux Slackware
    • DHCP Option Codes
    • DansGuardian with Squid and ClamAV
    • Fetchmail for Gmail accounts
    • Install Zend & APC PHP Optimizers
    • Install Atheros AR242x PCI Express Adapter
    • Install awstats with DirectAdmin
    • Install DBD::mysql via CPAN shell
    • Install DjbDNS on Ubuntu
    • Installing fail2ban on Centos 5
    • Install GoDaddy SSL Certificate
    • Install i386 packages under x86_64
    • Install Linux via USB flashdrive
    • Install ModSecurity2 on Apache2.0.x
    • Install Nginx on CentOS
    • Install webalizer with ispconfig
    • Install intel A/B/G/N wireless on linux
    • Kernel Upgrade
    • Mobile phone access via bluetooth
    • Optimize MySQL
    • Optimize Qmail
    • Optimize server load
    • Optimize and Tune Apache for performance
    • Optimize and Tune Nginx for performance
    • Perfect Mailserver on Debian
    • Pidgin "Now Playing" Status Message
    • PHP hardening
    • PHP hardening with Suhosin
    • PHP5 Support allong with PHP4
    • Previewing your site before making DNS changes
    • Proxy Auto Configuration
    • PXE boot install rescue
    • Setup awstats on CentOS
    • Setup EC2 Amazon L2TP IPSec VPN
    • Setup email piping with Qmail
    • Setup Exim with DKIM
    • Setup Exim smart relay with cPanel
    • Setup OpenVPN
    • Setup postfix on nonstandard port
    • Setup SS5 Socks Proxy
    • Setup vsftp with no shell access
    • Sendmail smart relay with gmail auth
    • Squid proxy NCSA authentication
    • Tcpdump filters
    • Upgrade PHP to 5.3 in Plesk 10
    • Useful regular expressions
    • X with [SiS] 771/671 VGA controller
  • Joomla Tutorials
    • Hardening Joomla
    • Module Positions
    • Remove Joomla description meta tag
  • Looking Glasses
  • Optimize Firefox
  • Security
    • Crack WiFi WEP passwords
    • Defend against UDP isc.org DNS query DDOS
    • Detect DDoS attack
    • Remove malware from web sites
    • Sniff SSL passwords with ettercap
    • Snort2BGP
    • Track Hackers
    • What Is My IP
  • Troubleshooting
    • Grub error no such disk
    • named dumping master file: tmp-XXXXXXXXXX: open: permission denied
    • Nginx 413 Request Entity Too Large
    • SSH conection closed by remote host
    • Troubleshooting sis190.c
  • Unix Tutorials
    • FreeBSD reset root password
    • Installing snort on OpenBSD
    • Unix Toolbox
  • Virtualization Tutorials
    • Convert VirtualBox image to VMWare
    • VMware SNMP Enable
  • VoIP Tutorials
    • Install Elastix
    • Qos for Asterisk

Who's Online

We have 16 guests and no members online

Most Read

  • Setup SS5 Socks Proxy
  • Install webalizer with ispconfig
  • Sniff SSL passwords with ettercap
  • __404__
  • Optimize and Tune Apache for performance

Products and Services

  • Home
  • Linux Products and Services
  • Buy VPN Account
  • Privacy Policy for Linuxexpert
  • Remove malware

PHP5 Support allong with PHP4

  • Print
  • Email
Details
Parent Category: Tutorials
Published: 25 October 2008
Hits: 3691

Note:

We use Hosting and VPS Hosting, from: www.star-host.org

We like and trust them.

Good prices, high security.

In this tutorial I'll show how you can run both php4 and php5 version on same host.
The following are the steps I took to get php5+gd+mysql support (in parallel with the default install of php) working with my Plesk hosted sites on FC2. Hopeful it might help someone else.


mkdir /usr/local/php5libpng
cd /usr/local/php5libpng

yum install zlib-devel

wget http://kent.dl.sourceforge.net/sourc...-config.tar.gz
gunzip libpng-1.2.8-config.tar.gz
tar -xvf libpng-1.2.8-config.tar


(remove extra dir’s created by the unzipping)

./configure '--prefix=/usr/local/php5libpng' '--exec-prefix=/usr/local/php5libpng'
make
make install


yum install mysql-devel
yum install libjpeg-devel



mkdir /usr/local/php5
cd /usr/local/php5

yum install libxml2-devel

yum install curl-devel

wget http://uk2.php.net/get/php-5.1.2.tar...php.net/mirror
gunzip php-5.1.2.tar.gz
tar -xvf php-5.1.2.tar


(remove extra dir’s created by the unzipping)

./configure '--host=i386-redhat-linux' '--build=i386-redhat-linux' '--target=i386-redhat-linux-gnu' '--prefix=/usr/local/php5' '--exec-prefix=/usr/local/php5' '--program-suffix=5' '--enable-force-cgi-redirect' '--enable-discard-path' '--enable-exif' '--enable-ftp' '--with-curl' '--with-bz2' '--enable-memory-limit' '--enable-inline-optimization' '--with-openssl' '--with-png' '--with-regex=system' '--with-xml' '--with-zlib' '--enable-sockets' '--enable-mbstring=shared' '--enable-mbstr-enc-trans' '--with-zlib' '--with-png-dir=/usr/local/php5libpng' '--with-gd' '--with-jpeg-dir=/usr/local/php5libjpeg' '--enable-gd-native-ttf' '--with-mysql'

make
make install



Create the file /home/httpd/vhosts/example.com/conf/vhost.conf with the following in it for each site:

ScriptAlias /php5-cgi-custom /home/httpd/vhosts/example.com/httpdocs
Action application/x-httpd-php5-custom "/php5-cgi-custom/php5"


Run: /usr/local/psa/admin/sbin/websrvmng --reconfigure-vhost --vhost-name=example.com


Create a .htaccess file with the following in the directories that need to be run by php5:

AddType application/x-httpd-php5-custom .php

Also don't forget about short_open_tag ( <? vs <?php ). You may also need to add this to your .htaccess file:

php_flag short_open_tag On


For each of the sites go to the base httpdocs directory (after ssh’ing in as the site user, not root): /home/httpd/vhosts/example.com/httpdocs/ and run cp /usr/local/php5/bin/php5 ./php5

Then chmod “php5” to 755 (php5 needs to be copied and run locally, since otherwise you get issues with suexec. If you have problems run cat /var/log/httpd/suexec_log and check any errors.


PHP5 should now work.

Note:

We use Hosting and VPS Hosting, from: www.star-host.org

We like and trust them.

Good prices, high security.

fShare
Tweet