logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Apache congiguration for multiple php
Author
manues50



Joined: 07 Aug 2018
Posts: 15
Location: India

PostPosted: Tue 07 Aug '18 17:43    Post subject: Apache congiguration for multiple php Reply with quote

Hello,

I have a Linux(CentOS) server running both php5.6 and 7.1
The default PHP is 5.6
Now I need to configure 7.1 for one website.

I don't find any configuration match in my requirements.

Can anyone help
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Wed 08 Aug '18 8:52    Post subject: Reply with quote

We have there several topics about that.

If you still have a question please ask again

https://www.apachelounge.com/viewtopic.php?t=3430
https://www.apachelounge.com/viewtopic.php?t=4986
http://www.apachelounge.com/viewtopic.php?t=5773
https://www.apachelounge.com/viewtopic.php?t=6615
Back to top
manues50



Joined: 07 Aug 2018
Posts: 15
Location: India

PostPosted: Wed 08 Aug '18 17:27    Post subject: Reply with quote

Hello James,

I don't find any configuration for linux.
I am not using fastcgi.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Thu 09 Aug '18 8:42    Post subject: Reply with quote

How do you run two different versions of PHP? It is not possible to do so with mod_php aka php7apache2_4 or php5apache2_4

I did not you already use mod_fcgid, but that it might be a solution for you.

How does your server run different PHP versions, if not over cgi or fast cgi?
Back to top
manues50



Joined: 07 Aug 2018
Posts: 15
Location: India

PostPosted: Thu 09 Aug '18 11:01    Post subject: Reply with quote

Hello James,

I just downloaded the package and installed new php in the different location.

here is the result I got while installation. (make install)

Installing shared extensions: /usr/local/php7/lib/php/extensions/no-debug-non-zts-20160303/
Installing PHP CLI binary: /usr/local/php7/bin/
Installing PHP CLI man page: /usr/local/php7/php/man/man1/
Installing phpdbg binary: /usr/local/php7/bin/
Installing phpdbg man page: /usr/local/php7/php/man/man1/
Installing PHP CGI binary: /usr/local/php7/bin/
Installing PHP CGI man page: /usr/local/php7/php/man/man1/
Installing build environment: /usr/local/php7/lib/php/build/
Installing header files: /usr/local/php7/include/php/
Installing helper programs: /usr/local/php7/bin/
program: phpize
program: php-config
Installing man pages: /usr/local/php7/php/man/man1/
page: phpize.1
page: php-config.1
Installing PEAR environment: /usr/local/php7/lib/php/
[PEAR] Archive_Tar - installed: 1.4.3
[PEAR] Console_Getopt - installed: 1.4.1
[PEAR] Structures_Graph- installed: 1.1.1
[PEAR] XML_Util - installed: 1.4.2
[PEAR] PEAR - installed: 1.10.5
Wrote PEAR system config file at: /usr/local/php7/etc/pear.conf
You may want to add: /usr/local/php7/lib/php to your php.ini include_path
/usr/local/src/php7.1-build/php-7.1.20/build/shtool install -c ext/phar/phar.phar /usr/local/php7/bin
ln -s -f phar.phar /usr/local/php7/bin/phar
Installing PDO headers: /usr/local/php7/include/php/ext/pdo/


And I just copied php.ini file

cp /usr/local/src/php7.1-build/php-7.1.20/php.ini-production /usr/local/php7/php.ini

then

I just rename file

mv /usr/local/php7/bin/php /usr/local/php7/bin/php7

Then I created a script

cat /etc/profile.d/php7.sh

pathmunge /usr/local/php7/bin/


php7 -v
PHP 7.1.20 (cli) (built: Aug 7 2018 16:04:22) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies

PHP 5.6.36 (cli) (built: May 18 2018 04:51:01)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

I dont know how to configre this in apache
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Fri 10 Aug '18 10:38    Post subject: Reply with quote

Hi Manues,
here my setup with mod_fcgid to have different php versions cause the mail software requires PHP 5.6

Code:

LoadModule fcgid_module modules/mod_fcgid.so

FcgidMaxProcesses 50
FcgidFixPathinfo 1
FcgidProcessLifeTime 0
FcgidTimeScore 3
FcgidZombieScanInterval 20
FcgidMaxRequestsPerProcess 0
FcgidMaxRequestLen 33554432
FcgidIOTimeout 120


Code:

<VirtualHost *:443>
    DocumentRoot /var/www_mail/
    ServerName mail.example.com
    <Directory /var/www_mail/>
        Options Indexes FollowSymlinks Multiviews ExecCGI
        AllowOverride None
        Require all granted

        AddHandler fcgid-script .php
        FCGIWrapper /usr/bin/php5-cgi .php
    </Directory>

    ErrorLog /var/log/apache2/ssl.mail.error.log
    TransferLog /var/log/apache2/ssl.mail.access.log

    SSLEngine on
    SSLCertificateFile /etc/letsencrypt/live/mail.example.com/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/mail.example.com/privkey.pem

    <Files ~"\.(cgi|shtml|phtml|php|htm|html?)$>
        SSLOptions +StdEnvVars
    </Files>
</VirtualHost>


<VirtualHost *:443>
    DocumentRoot /var/www/
    ServerName example.com
    <Directory /var/www/>
        Options Indexes FollowSymlinks Multiviews ExecCGI
        AllowOverride None
        Require all granted

        AddHandler fcgid-script .php
        FCGIWrapper /usr/bin/php-cgi7.1 .php
    </Directory>

    ErrorLog /var/log/apache2/ssl.error.log
    TransferLog /var/log/apache2/ssl.access.log

    SSLEngine on
    SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem

    <Files ~"\.(cgi|shtml|phtml|php|htm|html?)$>
        SSLOptions +StdEnvVars
    </Files>
</VirtualHost>
Back to top
manues50



Joined: 07 Aug 2018
Posts: 15
Location: India

PostPosted: Sat 11 Aug '18 17:32    Post subject: Reply with quote

I am unable to load modules and required files in this

System Linux ns3010594.ip-188-165-230.eu 3.14.32-xxxx-grs-ipv6-64 #1 SMP Tue Jun 30 18:50:21 CEST 2015 x86_64
Build Date Aug 7 2018 16:01:50
Configure Command './configure' '--prefix=/usr/local/php7'
Server API CGI/FastCGI
Virtual Directory Support disabled
Configuration File (php.ini) Path /usr/local/php7/lib
Loaded Configuration File (none)
Scan this dir for additional .ini files (none)
Additional .ini files parsed (none)
PHP API 20160303
PHP Extension 20160303
Zend Extension 320160303
Zend Extension Build API320160303,NTS
PHP Extension Build API20160303,NTS
Debug Build no
Thread Safety disabled
Zend Signal Handling enabled
Zend Memory Manager enabled
Zend Multibyte Support disabled
IPv6 Support enabled
DTrace Support disabled
Registered PHP Streams php, file, glob, data, http, ftp, phar
Registered Stream Socket Transports tcp, udp, unix, udg
Registered Stream Filters convert.iconv.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Tue 14 Aug '18 16:38    Post subject: Reply with quote

manues50 wrote:
I am unable to load modules


Where? In apache or in php? And why?
Back to top


Reply to topic   Topic: Apache congiguration for multiple php View previous topic :: View next topic
Post new topic   Forum Index -> Apache