PHP Selector

Started by Administrator, January 11, 2015, 05:03:05 AM

Previous topic - Next topic

Administrator

From version 0.9.8 all CWP servers have a CWP PHP Selector which can install all PHP versions with a single click.
Using CWP PHP selector you can use a different PHP version per folder or domain.

Available PHP versions in the CWP PHP Selector
- php 4.4
- php 5.2
- php 5.3
- php 5.4
- php 5.5
- php 5.6
- php 7.0
- php 7.1
- php 7.2
- php 7.x (development version from php git, don't use for production server!!!)

You can completely modify flags per PHP version according to you needs.

PHP per folder
Now each user can run PHP version per folder, meaning that each folder can have a different php version, example:
/home/USERNAME/public_html  runs PHP 5.4
/home/USERNAME/public_html/test  runs PHP 5.6
/home/USERNAME/public_html/my-domain.com  runs PHP 5.2
/home/USERNAME/public_html/my-domain.com/application runs PHP 5.3


Usage instructions
In each folder you want to run different PHP version you only need to define it in the .htaccess file.

Example for file: /home/USERNAME/public_html/.htaccess

Use PHP 4.4
AddHandler application/x-httpd-php44 .php

Use PHP 5.2
AddHandler application/x-httpd-php52 .php

Use PHP 5.3
AddHandler application/x-httpd-php53 .php

Use PHP 5.4
AddHandler application/x-httpd-php54 .php

Use PHP 5.5
AddHandler application/x-httpd-php55 .php

Use PHP 5.6
AddHandler application/x-httpd-php56 .php

Use PHP 7.0
AddHandler application/x-httpd-php70 .php

Use PHP 7.1
AddHandler application/x-httpd-php71 .php

Use PHP 7.2
AddHandler application/x-httpd-php72 .php


To run some other PHP version in the other folder, you can use the same example.

Example lets run php 5.3 in /home/USERNAME/public_html/domain1.com/
Edit /home/USERNAME/public_html/domain1.com/.htaccess file and add
AddHandler application/x-httpd-php53 .php

Example lets run php 5.2 in /home/USERNAME/public_html/domain2.com/
Edit /home/USERNAME/public_html/domain2.com/.htaccess file and add
AddHandler application/x-httpd-php52 .php


php.ini configuration file locations
/opt/alt/php44/usr/php/php.ini
/opt/alt/php52/usr/php/php.ini
/opt/alt/php53/usr/php/php.ini
/opt/alt/php54/usr/php/php.ini
/opt/alt/php55/usr/php/php.ini
/opt/alt/php56/usr/php/php.ini
/opt/alt/php70/usr/php/php.ini
/opt/alt/php71/usr/php/php.ini
/opt/alt/php72/usr/php/php.ini


php config file scan dir
/opt/alt/php44/usr/php/php.d
/opt/alt/php52/usr/php/php.d
/opt/alt/php53/usr/php/php.d
/opt/alt/php54/usr/php/php.d
/opt/alt/php55/usr/php/php.d
/opt/alt/php56/usr/php/php.d
/opt/alt/php70/usr/php/php.d
/opt/alt/php71/usr/php/php.d
/opt/alt/php72/usr/php/php.d


and so on.

To delete some php selector version use this command (example)
rm -Rf /opt/alt/php71

be careful with this command as you can easily delete wrong path.



AntiDDoS Protection (web + mail)
http://centos-webpanel.com/website-ddos-protection-proxy


Join our Development Team and get paid !
http://centos-webpanel.com/develope-modules-for-cwp





Services Monitoring & RBL Monitoring
http://centos-webpanel.com/services-monitor











Do you need Fast and FREE Support included for your CWP linux server?
http://centos-webpanel.com/noc-partner-list
Installation Instructions
http://centos-webpanel.com/installation-instructions

Get Fast Support Here
http://centos-webpanel.com/support-services

alexchar

When will 0,98 version be released? Sorry for my English!
Sorry for my English :(

Administrator

you can follow us on the facebook, there you can check for the new announcements.



AntiDDoS Protection (web + mail)
http://centos-webpanel.com/website-ddos-protection-proxy


Join our Development Team and get paid !
http://centos-webpanel.com/develope-modules-for-cwp





Services Monitoring & RBL Monitoring
http://centos-webpanel.com/services-monitor











Do you need Fast and FREE Support included for your CWP linux server?
http://centos-webpanel.com/noc-partner-list
Installation Instructions
http://centos-webpanel.com/installation-instructions

Get Fast Support Here
http://centos-webpanel.com/support-services

alexchar

It will be good if you can make newsletter via email.

Sorry for my English!
Sorry for my English :(

Bernie

How to remove a selected version?

jayraaj.chavan

I am getting Internal Server Error after adding AddHandler application/x-httpd-php54 .php to .htaccess file.

Administrator

you need to check apache logs



AntiDDoS Protection (web + mail)
http://centos-webpanel.com/website-ddos-protection-proxy


Join our Development Team and get paid !
http://centos-webpanel.com/develope-modules-for-cwp





Services Monitoring & RBL Monitoring
http://centos-webpanel.com/services-monitor











Do you need Fast and FREE Support included for your CWP linux server?
http://centos-webpanel.com/noc-partner-list
Installation Instructions
http://centos-webpanel.com/installation-instructions

Get Fast Support Here
http://centos-webpanel.com/support-services

muhittin

 Problem  :-[
İ install all php versions and my server working no problem. But when i want to use any one version php , i create a .htaccess file and type
AddHandler application/x-httpd-php56 .php
in .htaccess file save and restart copmlete VPS or apache server after try my site my site give  to me my index.php to save  my computer.?
how i am solve this problem?
Wants $10 bonus for FREE on VPS DigitalOcean

https://www.digitalocean.com/?refcode=4f7603c80195
-----------------------------------------------

zakrpa

hi

for me not works at all nothing happens even log file not exists strange...

Treiero

When installing the prerequisites, I noticed the following error early in the log:

"No package libc-client-devel.x86_64 available."

The rest went well and completed the installation of prerequisites, but when trying to install pacores PHP, the log file is not generated.


[root@ip-172-31-33-XXX ~]# tail -f /var/log/php-dependencies.log
Loaded plugins: fastestmirror, presto
Setting up Install Process
Determining fastest mirrors
* base: centos.xpg.com.br
* extras: centos.xpg.com.br
* rpmforge: repoforge.xpg.com.br
* updates: centos.xpg.com.br
No package libc-client-devel.x86_64 available.
Package libc-client-2007e-11.el6.i686 already installed and latest version
Package libc-client-2007e-11.el6.i686 already installed and latest version
Package flex-2.5.35-9.el6.i686 already installed and latest version
Package libjpeg-turbo-devel-1.2.1-3.el6_5.i686 already installed and latest version
Package gcc-4.4.7-16.el6.i686 already installed and latest version
Package 1:make-3.81-20.el6.i686 already installed and latest version
Package bison-2.4.1-5.el6.i686 already installed and latest version
Package bzip2-1.0.5-7.el6_0.i686 already installed and latest version
Package bzip2-devel-1.0.5-7.el6_0.i686 already installed and latest version
Package libcurl-devel-7.19.7-46.el6.i686 already installed and latest version
Package curl-7.19.7-46.el6.i686 already installed and latest version
Package 2:libpng-1.2.49-2.el6_7.i686 already installed and latest version
Package 2:libpng-devel-1.2.49-2.el6_7.i686 already installed and latest version
Package freetype-2.3.11-15.el6_6.1.i686 already installed and latest version
Package freetype-devel-2.3.11-15.el6_6.1.i686 already installed and latest version
Package krb5-devel-1.10.3-42.el6.i686 already installed and latest version
Package krb5-libs-1.10.3-42.el6.i686 already installed and latest version
Package libmcrypt-2.5.8-9.el6.i686 already installed and latest version
Package libmcrypt-devel-2.5.8-9.el6.i686 already installed and latest version
Package expat-devel-2.0.1-11.el6_2.i686 already installed and latest version
Package libxml2-2.7.6-20.el6_7.1.i686 already installed and latest version
Package libxml2-devel-2.7.6-20.el6_7.1.i686 already installed and latest version
Package libxslt-1.1.26-2.el6_3.1.i686 already installed and latest version
Package libxslt-devel-1.1.26-2.el6_3.1.i686 already installed and latest version
Nothing to do

Install Completed
###############################



[root@ip-172-31-33-XXX ~]# tail -f /var/log/php-selector-rebuild.log
tail: cannot open `/var/log/php-selector-rebuild.log' for reading: No such file or directory
tail: no files remaining

rflsantana


pixelpadre

I am not clear on the difference between PHP Switcher and PHP Selector.  Can you explain?

become

How can I use PHP 7 ?
I have added:

AddHandler application/x-httpd-php71 .php

and when I try to run php script It get downloaded by browser

devnull



What result do you get if you use?:

AddHandler application/x-httpd-php7 .php

That is working for me.

I think the wiki should be updated though.

Php 7 is not there yet ;)

See http://wiki.centos-webpanel.com/php-selector

become

used CWP build in compilation function