Sponsor:

Server and Web Integrator
Link:
Kloxo-MR logo
6.5.0 or 7.0.0
Click for "How to install"
Donation/Sponsorship:
Kloxo-MR is open-source.
Donate and or Sponsorship always welcome.
Click to:
Click Here
Please login or register. 2024-03-28, 13:28:50

Author Topic: Multiple PHP Enable  (Read 12303 times)

0 Members and 1 Guest are viewing this topic.

Offline LotsOfQ

  • Master
  • **
  • Posts: 462
  • Karma: +1/-0
    • View Profile
Multiple PHP Enable
« on: 2015-04-15, 06:21:31 »
Is this feature "Multiple PHP Enable" working yet? And if so then how do we use it?

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Multiple PHP Enable
« Reply #1 on: 2015-04-15, 06:27:03 »
Still not work. But, you can use various php in website via 'secondary php'.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline LotsOfQ

  • Master
  • **
  • Posts: 462
  • Karma: +1/-0
    • View Profile
Re: Multiple PHP Enable
« Reply #2 on: 2015-04-15, 08:21:42 »
Thank you for your answer.

How does this work? Do you have any post on this that I can read up on?
Quote
But, you can use various php in website via 'secondary php'.

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Multiple PHP Enable
« Reply #3 on: 2015-04-15, 09:04:34 »
1. goto to 'admin > webserver configure'
2. Install all php in 'multiple php install' until show in 'Multiple PHP Already Installed'
3. Use one 'phpXYm' in 'php used' as 'base php' in 'webserver configure'
4. select 'php-fpm_event' for 'php type' also enable 'Enable PHP 5.2 (use Php52s) As Secondary PHP' (it's wrong description because possible not php 5.2 only)
5. go to 'admin > switch program' and select apache or proxy (like nginxproxy)
6. Restart webserver with 'sh /script/restart-web -y' from ssh or 'admin > command center'
7. Add:
Code: [Select]
<Ifmodule !mod_php5.c>
    AddHandler x-httpd-php52 .php
    #AddHandler x-httpd-php .php
</Ifmodule>
in top line of /home/<user>/<domain>/.htaccess (change php52 to php53 if want to use php 5.3)

8. Testing php with create phpinfo.php with content '<?php phpinfo(); ?>'

Note:
- You can see this feature with access to:
Code: [Select]
http://xl2.mratwork.com/php52/
http://xl2.mratwork.com/php53/
http://xl2.mratwork.com/php54/
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline LotsOfQ

  • Master
  • **
  • Posts: 462
  • Karma: +1/-0
    • View Profile
Re: Multiple PHP Enable
« Reply #4 on: 2015-04-15, 10:52:50 »
Wow... this is perfect if I understand it correctly. Awesome. Just what I needed but never though it was possible. I will test now.

Oh... is it possible to not just apply this to domain but also directory. ex. /home/user/domain/thisdir/.htaccess?

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Multiple PHP Enable
« Reply #5 on: 2015-04-15, 11:17:15 »
Wow... this is perfect if I understand it correctly. Awesome. Just what I needed but never though it was possible. I will test now.

Oh... is it possible to not just apply this to domain but also directory. ex. /home/user/domain/thisdir/.htaccess?

Yes, possible different php version per-directory. Did you see http://xl2.mratwork.com/
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline LotsOfQ

  • Master
  • **
  • Posts: 462
  • Karma: +1/-0
    • View Profile
Re: Multiple PHP Enable
« Reply #6 on: 2015-04-15, 11:22:56 »
Yeah, I saw it. That's exactly what I want. I am trying it on my end but not working. Everytime I open a page it start to download it instead. Any idea?

By they way, this is fixed when I switch to php54. http://forum.mratwork.com/kloxo-mr-technical-helps/headers-and-client-library-minor-version-mismatch-headers50173-library50312/

Offline LotsOfQ

  • Master
  • **
  • Posts: 462
  • Karma: +1/-0
    • View Profile
Re: Multiple PHP Enable
« Reply #7 on: 2015-04-15, 12:02:11 »
Ok, so it works. The reason why it didn't the directory already have an .htaccess file with this on it.

Quote
<FilesMatch "\.inc$">
        #Order allow,deny
        #Deny from all
</FilesMatch>

So I did this and it didn't work.
Quote
<Ifmodule !mod_php5.c>
    AddHandler x-httpd-php52 .php
    #AddHandler x-httpd-php .php
</Ifmodule>

<FilesMatch "\.inc$">
        #Order allow,deny
        #Deny from all
</FilesMatch>

But this alone work.

Quote
<Ifmodule !mod_php5.c>
    AddHandler x-httpd-php52 .php
    #AddHandler x-httpd-php .php
</Ifmodule>

How do I have it together?

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Multiple PHP Enable
« Reply #8 on: 2015-04-15, 12:09:57 »
Let say:

- directory '/home/admin/xl2.mratwork.com/php52' with content 'AddHandler x-httpd-php52 .php' inside '/home/admin/xl2.mratwork.com/php52/.htaccess'

- directory '/home/admin/xl2.mratwork.com/php53' with content 'AddHandler x-httpd-php53 .php' inside '/home/admin/xl2.mratwork.com/php53/.htaccess'
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline LotsOfQ

  • Master
  • **
  • Posts: 462
  • Karma: +1/-0
    • View Profile
Re: Multiple PHP Enable
« Reply #9 on: 2015-04-15, 12:21:47 »
I think you missed my last post. I am wondering what do I do if I have already have existing .htaccess with code inside.

Offline LotsOfQ

  • Master
  • **
  • Posts: 462
  • Karma: +1/-0
    • View Profile
Re: Multiple PHP Enable
« Reply #10 on: 2015-04-15, 12:36:32 »
Sorry I was wrong. When I have change php52 then it work fine. But when I change it to php53 that's when it download the page or file.
« Last Edit: 2015-04-15, 12:40:31 by LotsOfQ »

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Multiple PHP Enable
« Reply #11 on: 2015-04-15, 12:52:50 »
Inform here 'dir -l /opt; php53m-cli -v;cat /etc/suphp.conf; cat /etc/httpd/conf.d/suphp52.conf'
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline LotsOfQ

  • Master
  • **
  • Posts: 462
  • Karma: +1/-0
    • View Profile
Re: Multiple PHP Enable
« Reply #12 on: 2015-04-15, 13:01:28 »
Quote
total 28
drwxr-xr-x 20 root root 4096 Apr 12 04:53 configs
drwxr-xr-x  6 root root 4096 Apr 15 10:50 php52m
drwxr-xr-x  6 root root 4096 Apr 14 13:05 php53m
drwxr-xr-x  6 root root 4096 Apr 14 13:05 php54m
drwxr-xr-x  6 root root 4096 Apr 12 04:50 php54s
drwxr-xr-x  6 root root 4096 Apr 15 10:51 php55m
drwxr-xr-x  6 root root 4096 Apr 15 10:52 php56m
PHP 5.3.29 (cli) (built: Aug 14 2014 11:50:05)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2014 Zend Technologies
[global]
logfile=/var/log/httpd/suphp_log
loglevel=info
webserver_user=apache
docroot=/
env_path=/bin:/usr/bin
umask=0022
min_uid=48
min_gid=48

; Security options
allow_file_group_writeable=true
allow_file_others_writeable=false
allow_directory_group_writeable=true
allow_directory_others_writeable=false

;Check wheter script is within DOCUMENT_ROOT
check_vhost_docroot=false

;Send minor error messages to browser
errors_to_browser=false

[handlers]
;Handler for php-scripts
x-httpd-php="php:/usr/bin/php-cgi"
x-httpd-php52="php:/opt/php52m/custom/php-cgi.sh"
x-httpd-php53="php:/opt/php53m/custom/php-cgi.sh"
x-httpd-php54="php:/opt/php54m/custom/php-cgi.sh"
x-httpd-php55="php:/opt/php55m/custom/php-cgi.sh"

;Handler for CGI-scripts
x-suphp-cgi="execute:!self"

;;; MR -- for using php52 just enough add 'AddHandler x-httpd-php52 .php' on .htaccess.
;;; The same way for php53 until php55
;;; it's make possible running 'multiple php' on server!
### MR -- read /usr/local/lxlabs/kloxo/file/apache/conf.d/suphp.conf.original for full description ###

LoadModule suphp_module modules/mod_suphp.so

suPHP_Engine On

#AddHandler x-httpd-php .php
#AddHandler x-httpd-php .php .php4 .php3 .phtml

suPHP_AddHandler x-httpd-php
suPHP_AddHandler x-httpd-php52

DirectoryIndex index.php

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Multiple PHP Enable
« Reply #13 on: 2015-04-15, 13:18:59 »
In /etc/httpd/conf.d/suphp52.conf, add:
Code: [Select]
suPHP_AddHandler x-httpd-php53
suPHP_AddHandler x-httpd-php54
suPHP_AddHandler x-httpd-php55

under:
Code: [Select]
suPHP_AddHandler x-httpd-php
suPHP_AddHandler x-httpd-php52
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline LotsOfQ

  • Master
  • **
  • Posts: 462
  • Karma: +1/-0
    • View Profile
Re: Multiple PHP Enable
« Reply #14 on: 2015-04-15, 13:34:47 »
Work perfectly!!! Thank you so much. You're best!

 


Top 4 Global Search Engines:    Google    Bing    Baidu    Yahoo

Page created in 0.1 seconds with 21 queries.

web stats analysis