Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Change php version Apache uses

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
banderas20
Posts: 111
Joined: 2016-11-10 15:30

Change php version Apache uses

#1 Post by banderas20 »

Hello,

I have come to have php 7.0, 7.1 and 7.2 installed on a single system.

My apache2 is using php 7.0, and I want to force it to use 7.1.

I have taken a look at

Code: Select all

apache2.conf
, but I can't find anything related to php version.
On the other hand, I can't find

Code: Select all

httpd.conf
.

¿Any help?

Thanks!

User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Change php version Apache uses

#2 Post by GarryRicketson »

http://www.control-escape.com/web/confi ... ebian.html
You should read the above link, completly, below is just some pieces:
Configuring Apache 2 on Debian, Ubuntu

The Debian distribution of Linux includes the Apache web server, both the venerable version 1 and the more modern version 2. The Debian maintainers have a peculiar way of arranging the configuration files for Apache 2.0 which is not documented in the standard Apache documentation. This introduction should help you get acclimated to the Debian way of configuring Apache 2.0.
=====================
Conclusion and Resources

Although Debian’s configuration setup for Apache 2 is non-standard, it is still fairly easy to understand, and it provides tools that make life easier for the administrators of web servers that change often or serve multiple web sites. For additional help, view the Debian README file at /etc/apache2/README. For general information on configuring Apache, try these resources.
Have you read the README file ?
Since I do not use apache2, I do not have it handy, but it seems like that is what you should read first.
What does this command show ?:

Code: Select all

locate httpd.conf
 
======== edit ====
according to this,https://wiki.apache.org/httpd/DistrosDe ... pd_2.x.29:
This guide lists the default installation layouts for Apache HTTPD on various operating systems and distributions.
While examples in the main Apache HTTP Server documentation assume that you are using the standard file layout distributed from apache.org, many third-party distributors change the layout to conform to local policies. This can make it difficult to follow the examples and to find various important files. Using the information below, you can find where things live on your local install, and compare it to the standard Apache httpd paths.
there is no httpd.conf file:

Code: Select all

ServerRoot              ::      /etc/apache2
DocumentRoot            ::      /var/www
Apache Config Files     ::      /etc/apache2/apache2.conf
                        ::      /etc/apache2/ports.conf
Default VHost Config    ::      /etc/apache2/sites-available/default, /etc/apache2/sites-enabled/000-default
Module Locations        ::      /etc/apache2/mods-available, /etc/apache2/mods-enabled
ErrorLog                ::      /var/log/apache2/error.log
AccessLog               ::      /var/log/apache2/access.log
cgi-bin                 ::      /usr/lib/cgi-bin
binaries (apachectl)    ::      /usr/sbin
start/stop              ::      /etc/init.d/apache2 (start|stop|restart|reload|force-reload|start-htcacheclean|stop-htcacheclean) 

banderas20
Posts: 111
Joined: 2016-11-10 15:30

Re: Change php version Apache uses

#3 Post by banderas20 »

Hello!

I have done it by replacing the symlinks in

Code: Select all

/etc/apache2/mods-enabled
directory to proper php version in

Code: Select all

/etc/apache2/mods-available
Thanks!

Post Reply