[PlugIn] PHP Version selector FREE!

walo

Verified User
Joined
Mar 19, 2005
Messages
156
This is the first release of the PHP Version selector plugin.

PHP Version selector allow users to select which version of php want to use on each domain.
Of course, the server must have 2 different version of PHP installed.

It support PHP4, PHP5 and PHP6, on CLI o CGI mode. You can do any combination.

Download: http://www.outservices.net/da/phpvs.php

Screenshots:
Admin config: http://www.outservices.net/da/phpvs_sadmin.png
User panel: http://www.outservices.net/da/phpvs_suser.png



FAQs:

How does it work?
The simple way you use a different version of PHP on a website, is to create a .htaccess file and set the mime type of the php version. Well, PHP Version selector does this.

What happen if an existing .htaccess file is on the public_html folder of the domain?
Don't worry, PHP Version Selector add a new line without altering the actual content.

Default mime type does not work on my server
You can change it. It is very easy.

My entry panel is in other language and my users don't understand english
PHP Version selector allow you to change the language. Just edit the 4 lines on /usr/local/directadmin/plugins/phpvs/data/lang.txt

It is safe to use it?
Totally. This plugin only create and/or edit an .htaccess file. If something goes bad, you can revert all.

When i change the PHP version of a site i get error 500 Internal server error
In this case check the PHP Version selector configuration and make sure that match with you PHP version installed. Also you can check the mime types and the .htaccess file of the domain.

Where is the .htaccess file created?

For now, PHP Version selector only support domain, the .htaccess file is created on the public_html folder of each domain.

It is free?
No fees, no encrypted files. It is 100% free.
 
This was an idea i had and im glad you did it for nothing.

Thanks MR!!!
 
an existing .htaccess file is on the public_html folder ? if there already have other .htaccess file then will be recover or major together ?

BR.,
 
Does this plugin only work in combination with custombuild? Or can u use it with regular version to?
This plugin only change the "AddHandler" method in a .htaccess file.

an existing .htaccess file is on the public_html folder ? if there already have other .htaccess file then will be recover or major together ?

BR.,
If exists another .htaccess file on the domain, the plugin will append a new line to it.
 
So, you don't use "FilesMatch" directive at all? If you don't then anyfile.php.anyext will be executed as a PHP file.
 
mine did not work.

it only appear in admin section to see who can choose php section

but it does not appear in the user section :(
 
having trouble with this too...

Yeah, I'm having trouble with this too. I have PHP4 CLI and PHP5 CGI installed via custombuild, both are running. I have the PHP selector plug-in installed, and it appears to be working correctly, in that it does write the htaccess files as promised. But the htaccess files don't seem to have any effect. If a filename ends in .php it gets executed by php4. If it ends with .php5, it gets executed by php5. The plug in doesn't seem to be effecting anything one way or the other.

Any ideas what I'm doing wrong?

:confused:
 
mine did not work.

it only appear in admin section to see who can choose php section

but it does not appear in the user section :(

It should appear as "PHP Version Selector" in both admin and user level, if you have installed the plugin correctly. Make sure you were not refering to "PHP SafeMode Configuration".


Yeah, I'm having trouble with this too. I have PHP4 CLI and PHP5 CGI installed via custombuild, both are running. I have the PHP selector plug-in installed, and it appears to be working correctly, in that it does write the htaccess files as promised. But the htaccess files don't seem to have any effect. If a filename ends in .php it gets executed by php4. If it ends with .php5, it gets executed by php5. The plug in doesn't seem to be effecting anything one way or the other.

Any ideas what I'm doing wrong?

:confused:
Did you set PHP5 as the default version? I have no problem with this.
 
Yeah, I'm having trouble with this too. I have PHP4 CLI and PHP5 CGI installed via custombuild, both are running. I have the PHP selector plug-in installed, and it appears to be working correctly, in that it does write the htaccess files as promised. But the htaccess files don't seem to have any effect. If a filename ends in .php it gets executed by php4. If it ends with .php5, it gets executed by php5. The plug in doesn't seem to be effecting anything one way or the other.

Any ideas what I'm doing wrong?

:confused:
The plugin only add/change/remove handler lines in the .htaccess files. In the admin you can modify this lines, so maybe you will need to review that lines or check your server permissions
 
The plugin only add/change/remove handler lines in the .htaccess files. In the admin you can modify this lines, so maybe you will need to review that lines or check your server permissions

Well, I've tried every variation on those lines I can think of, and I'm not having any luck. I also switched things around so that PHP5 is now the default instead of 4. It doesn't seem to make any difference. My error logs don't provide any clues either. I'm stumped...
 
I found a solution that works in this thread:

http://www.directadmin.com/forum/showthread.php?p=132531

It looks like you have to use this:

Code:
<FilesMatch "\.(inc|php|php3|php4|php5|php6|phtml|phps)$">
AddHandler x-httpd-php4 .php 
</FilesMatch>

So I can now use htaccess to choose PHP 4 or 5 -- that's the good news. :)

The bad news is, it requires 3 lines of code, and as far as I can tell, the plug in only allows one line. So, I'll manage this manually for now I guess. Maybe this is something that a future update of the plug-in can include?
 
If a filename ends in .php it gets executed by php4. If it ends with .php5, it gets executed by php5.

I dont understand, you said you have php4 as default, so wts the problem?

if you want .php to be executed as php5, then you should set the default version to php5.
 
I dont understand, you said you have php4 as default, so wts the problem?

if you want .php to be executed as php5, then you should set the default version to php5.

I wanted to be able to use the PHP Version plug-in to be able to set the default PHP version on a per-user basis. What I described above was what was happening for all users, regardless of what I did with the plug-in.

But I have it working now. Thanks for your help!
 
Back
Top