Jump to content
Froxlor Forum
  • 0

[solved] how to set php version in htaccess using FCGID?


sagacitysite

Question

hey there,

after spending a real lot time googling, finally I have to ask a question.. maybe I made something wrong.

The goal: I want to set the php version to php 5.2 for a specific user/domain

What I did:

1. I installed FCGID, following the configuration in froxlor and using this (https://redmine.froxlor.org/projects/froxlor/wiki/FCGID_-_Handbuch) respectively this (https://redmine.froxlor.org/projects/froxlor/wiki/FCGID_-_handbook) handbook.

2. In apache2.conf I set "AllowOverride all"

<Directory />
    Options FollowSymLinks
    AllowOverride All
    Require all denied
</Directory>

3. Apache seems to accept the .htaccess file. When I write some stupid stuff inside, I get "Internal Server Error". So Apache seems to read my .htaccess. And when I activate e.g. mod_rewrite, everything ist pretty OK and is working as expected.

But:

When I use

AddHandler application/x-httpd-php52 .php

it will not work. "phpversion()" gives me 5.5.9.. but thats not what I wanted to have!


In error-log of Apache (/var/log/apache2), I only have some notices, no real errors.. Has anyone an approach?

Thanks for any advice!

PS: using ubuntu 14.04

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

thanks for that, it pushed me to the right direction and sorry for my newbie question! :)

 

After some reading and trying it works now. For all the other newbie's like me (maybe Google bringing them to this post) here are the steps, which brought it for me (after the step number 1 in my origin post):

 

1. Compiling php binaries

--with-mysqli \
--with-mysql \
  • Impotant: If you compile again (e.g. for changing the options), you have to go to the sources (in phpfarm folder -> src/php-**/) and you have to run "make clean". Otherwise you can have errors. I was struggeling with this a while ;)

2. Configure php version for specific domain

  • In Froxlor GUI you have to choose "php configuration" in menu. Here you create a new one and call it whatever you want (in my case "php 5.3" for example).
  • You can leave the settings as they are, you only have to change the "php binary" field. Here you have to change the path to your php version. In my case it is "/var/www/html/cgi-bin/php-cgi-5.3.29"
  • Last step: You edit your domain and scroll down to "php settings". Here you choose your new configuration file for that domain in the dropdown, save and make sure cron is running.

 

That's it! I hope it helps :)

Link to comment
Share on other sites

That's not how it works. If you have another php-binary installed on your system, you can add a new php-configuration in froxlor where you specify the exact php-binary (e.g. /usr/bin/php-5.2 or whatever) and then edit the domain(s) you want this config to use and select it from the php-config select-box. There is NO way you can do this via .htaccess

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.



×
×
  • Create New...