{"id":56,"date":"2015-01-18T22:45:42","date_gmt":"2015-01-18T14:45:42","guid":{"rendered":"http:\/\/blog.qiaogen.com\/?p=56"},"modified":"2015-01-18T22:45:42","modified_gmt":"2015-01-18T14:45:42","slug":"how-to-install-php-5-2-on-cpanelwhm-11-40","status":"publish","type":"post","link":"https:\/\/www.sangqiao.com\/blog\/archives\/56","title":{"rendered":"How To Install PHP 5.2 on cPanel\/WHM 11.40+"},"content":{"rendered":"<p>cPanel, Inc. has released EasyApache 3.24. This version removes Apache 1.3\/2.0, PHP 5.2, and mod_frontpage. As mentioned in<br \/>\nIntroducing EasyApachea Optimal Profiles, These End of Life (EOL) items are no longer available in EasyApache.<\/p>\n<p>These items have been removed for the following reasons:<\/p>\n<p>* They are no longer supported by their respective developers.<br \/>\n* They include unpatched CVEs (Common Vulnerabilities and Exposures).<br \/>\n* EasyApache provides the most up-to-date, supported versions of Apache (2.2\/2.4) and PHP (5.4\/5.5).<\/p>\n<p>Keep in mind that viable alternatives to mod_frontpage exist, such as WebDAV and FTP. Also, PHP 5.2 and mod_frontpage are available as custom modules (\u201copt mods\u201d).<\/p>\n<p>You can read more about how to use and install Custom Modules at : http:\/\/docs.cpanel.net\/twiki\/bin\/view\/EasyApache\/EasyApacheCustomModules<\/p>\n<p>Downgrading PHP version is not a good idea.We always suggest you to use latest updates version of software\/Scripts you are using.In new cPanel version they have completely dropped support for PHP version 5.2 .If you PHP is corrupted or need to recompile it for some reason then you can\u2019t rebuild your old PHP version using EasyApache (3.24) .So you may have to do it at custom.You can do this by following the steps given below.<\/p>\n<p>Install Dependencies using \u2018YUM\u2019<\/p>\n<pre># yum install libcurl-devel libmcrypt libmcrypt-devel aspell aspell-devel tidy libtidy libtidy-devel libxslt libxslt-devel \r\n\r\n# cd \/var\/cpanel\/easy\/apache\/custom_opt_mods\/\r\n\r\n# wget http:\/\/docs.cpanel.net\/twiki\/pub\/EasyApache\/EasyApacheCustomModules\/custom_opt_mod-PHP5217.tar.gz\r\n\r\n# tar -C \/var\/cpanel\/easy\/apache\/custom_opt_mods -xzf custom_opt_mod-PHP5217.tar.gz\r\n\r\n# nano \/var\/cpanel\/easy\/apache\/rawopts\/all_php5\r\n\r\n--------------------------\r\n\r\n--with-curl \r\n--with-gd\r\n--enable-exif\r\n--with-gettext\r\n--with-imap=\/opt\/php_with_imap_client\/\r\n--enable-mbstring\r\n--with-mysql-sock=\/var\/lib\/mysql\/mysql.sock\r\n--with-mysqli=\/usr\/bin\/mysql_config\r\n--with-openssl=\/usr\r\n--enable-pdo=shared\r\n--with-pdo-mysql=shared\r\n--with-pdo-sqlite=shared\r\n--with-sqlite=shared\r\n--with-mime-magic\r\n--enable-soap\r\n--with-pspell\r\n--enable-wddx\r\n--with-xmlrpc\r\n--with-xsl=\/opt\/xslt\/\r\n--with-kerberos\r\n--with-curl\r\n--enable-zip<\/pre>\n<p>** You can enable all relevant PHP modules in \u201c\/var\/cpanel\/easy\/apache\/rawopts\/all_php5\u2033.<\/p>\n<p>Then recompile Apache using \u201c\/scripts\/easyapache\u201d. Go to step 3 \u201cPlease choose which specific PHP version(s) to build\u201d<br \/>\nIf you want no PHP except 5.2 then on the \u201cPHP Version\u201d screen chose \u201cNone\u201d and continue to step 4, The \u201cShort Options List\u201d page you will see \u201cPHP 5.2.17 support (no FastCGI)\u201d listed. Check that box and continue your EasyApache like normal.<\/p>\n<p>After EasyApache you can re-install IonCubeLoader and Zendopt using :<\/p>\n<pre># \/scripts\/phpextensionmgr install IonCubeLoader\r\n# \/scripts\/phpextensionmgr install Zendopt<\/pre>\n<p>You can install the following PHP extensions using script \u2018\/scripts\/phpextensionmgr\u2019<\/p>\n<p>* EAccelerator<br \/>\n* IonCubeLoader<br \/>\n* Zendopt<br \/>\n* Xcache<br \/>\n* SourceGuardian<br \/>\n* PHPSuHosin<\/p>\n<p>If necessary you can install other missing PHP modules without doing Easyapache.You can do this simply by login into the server as root :<\/p>\n<pre># cd \/home\/cpeasyapache\/src\/php-5.2.17\/ext\/mcrypt\/  (Go to particular extension folder,Here I need to install Mcrypt)\r\n\r\n# phpize\r\n\r\n# .\/configure\r\n\r\n# make\r\n\r\n# make install<\/pre>\n<p>After that you can see extension directory path:<\/p>\n<pre># php -i | grep extension_dir\r\n\r\n# ls -al  \/usr\/local\/lib\/php\/extensions\/no-debug-non-zts-20060613\/mcrypt.so\r\n\r\n# vi \/usr\/local\/lib\/php.ini<\/pre>\n<p>add extension=\u201dmcrypt.so\u201d .Then restart apache using :<\/p>\n<pre># \/etc\/init.d\/httpd restart<\/pre>\n<p>Other method is:<\/p>\n<pre># wget -O \/usr\/local\/src\/tidy-1.2.tgz http:\/\/pecl.php.net\/get\/tidy-1.2.tgz\r\n\r\n# cd \/usr\/local\/src\/\r\n\r\n# tar zxvf tidy-1.2.tgz\r\n\r\n# cd tidy-1.2\r\n\r\n# phpize\r\n\r\n# .\/configure\r\n\r\n# make\r\n\r\n# make install\r\n\r\n# php -i | grep extension_dir\r\n\r\n# ls -al  \/usr\/local\/lib\/php\/extensions\/no-debug-non-zts-20060613\/tidy.so\r\n\r\n# vi \/usr\/local\/lib\/php.ini<\/pre>\n<p>add extension=\u201dtidy.so\u201d extension under your extension directory path and restart apache using:<\/p>\n<pre># \/etc\/init.d\/httpd restart<\/pre>\n<p>That\u2019s it !<\/p>\n<p>Author<br \/>\nVipin Praphakaran<br \/>\nSenior Support Enginner<br \/>\nSyslint.com<\/p>\n","protected":false},"excerpt":{"rendered":"<p>cPanel, Inc. has released EasyApache 3.24. This version [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"_links":{"self":[{"href":"https:\/\/www.sangqiao.com\/blog\/wp-json\/wp\/v2\/posts\/56"}],"collection":[{"href":"https:\/\/www.sangqiao.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sangqiao.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sangqiao.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sangqiao.com\/blog\/wp-json\/wp\/v2\/comments?post=56"}],"version-history":[{"count":1,"href":"https:\/\/www.sangqiao.com\/blog\/wp-json\/wp\/v2\/posts\/56\/revisions"}],"predecessor-version":[{"id":57,"href":"https:\/\/www.sangqiao.com\/blog\/wp-json\/wp\/v2\/posts\/56\/revisions\/57"}],"wp:attachment":[{"href":"https:\/\/www.sangqiao.com\/blog\/wp-json\/wp\/v2\/media?parent=56"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sangqiao.com\/blog\/wp-json\/wp\/v2\/categories?post=56"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sangqiao.com\/blog\/wp-json\/wp\/v2\/tags?post=56"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}