change php.ini location

General questions relating to Joomla! 3.x.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
Locked
AlohaYoga
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 104
Joined: Sat Jul 23, 2016 4:03 pm

change php.ini location

Post by AlohaYoga » Thu Nov 23, 2017 5:18 pm

Hi,

I need to change the location of the php.ini file that is loaded by joomla. Any idea how I can tell joomla where the new location is?

Thanks!!

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44093
Joined: Sat Apr 05, 2008 9:58 pm

Re: change php.ini location

Post by Webdongle » Thu Nov 23, 2017 5:22 pm

Why bother changing the location ?
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

AlohaYoga
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 104
Joined: Sat Jul 23, 2016 4:03 pm

Re: change php.ini location

Post by AlohaYoga » Thu Nov 23, 2017 5:42 pm

Because joomla is not detecting the correct location. I have a server with multiple IPs and Joomla is using the one at the root of the server instead of using the one at the root of the IP.

AlohaYoga
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 104
Joined: Sat Jul 23, 2016 4:03 pm

Re: change php.ini location

Post by AlohaYoga » Thu Nov 23, 2017 6:40 pm

It is not a cache problem.

When I go in the --> "system" --> "system information" --> "PHP information" the location written under the --> "Configuration File (php.ini) Path" or "Loaded Configuration File" is wrong. It gives the php.ini at the root of the server but it should be the php.ini at the base of the IP.

I need to change this.

I don't see what the template or favicon has to do with this. (?)

EDIT: just to add more info. I have a component that uses the php.ini file config to do things. When I change the config of the PHP.ini at the root of the server it works. When I change the config of the PHP.ini of the IP, it doesn't. Why? because joomla is using the php.ini at the root of the server but it should be using the one at the root of the IP.

so... How do I tell joomla what php.ini to use? (or change the location of the php.ini)

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44093
Joined: Sat Apr 05, 2008 9:58 pm

Re: change php.ini location

Post by Webdongle » Thu Nov 23, 2017 7:10 pm

My bad I misread the post. OK the main php.ini file is server root. That location is set but you can use local php.ini files ... however those files are often not recursive. You can change many php settings in a .htaccess files and that is recursive.

If you look at the 'Loaded Configuration File' you will see the location of main php.ini file. If you look further down you will see two headings ... one is the Local value the other is the Master value. The former will show differently if you have a local php.ini file (or changed settings in the .htaccess).
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 30937
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: change php.ini location

Post by Per Yngve Berg » Thu Nov 23, 2017 8:22 pm

AlohaYoga wrote:so... How do I tell joomla what php.ini to use? (or change the location of the php.ini)
Joomla does not use any php.ini file. It's used by php and Joomla runs of top of that with the configuration that php have on the server.

User avatar
AMurray
Joomla! Exemplar
Joomla! Exemplar
Posts: 9744
Joined: Sat Feb 13, 2010 7:35 am
Location: Australia

Re: change php.ini location

Post by AMurray » Thu Nov 23, 2017 9:22 pm

Interested in knowing which component has to use specific settings in the PHP.ini and why....what settings specifically is it needing to use?
Regards - A Murray
General Support Moderator

AlohaYoga
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 104
Joined: Sat Jul 23, 2016 4:03 pm

Re: change php.ini location

Post by AlohaYoga » Thu Nov 23, 2017 10:30 pm

Per Yngve Berg wrote:
AlohaYoga wrote:so... How do I tell joomla what php.ini to use? (or change the location of the php.ini)
Joomla does not use any php.ini file. It's used by php and Joomla runs of top of that with the configuration that php have on the server.
In the system, joomla is choosing a php (as described above) In this case it is choosing the root php.ini

I am guessing that to have a server with multiple IPs and joomla on it is rare. But, in this case, Joomla is choosing the one located at the root of the server instead of the php.ini file located at the root of the IP.

Anyway, I'm guetting from the responses that joomla can't change the location of the php.ini file since it was probably not built for multiple IPs on a server. So, instead, I'll tell you want I need IN the php.ini.

One component needs "allow_url_fopen" to be "on". I wanted to avoid the htaccess option and get a truly clean choice of turning on "allow_url_fopen". I also, don't necessairly want it to be "on" for the whole server. As you probably know, servers with multiple IPs, which have WHM and cpanel, can adjust the php.ini settings for each IP. It would be a pain to only have a global file, you can imagine.

Nevertheless, joomla is not using the local php.ini (the one on the dedicated IP where the joomla is located) but the root php.ini of the server.

So, I'm looking for ideas :)

Thanks everyone for your input.

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44093
Joined: Sat Apr 05, 2008 9:58 pm

Re: change php.ini location

Post by Webdongle » Thu Nov 23, 2017 10:48 pm

AlohaYoga wrote:
Per Yngve Berg wrote:... But, in this case, Joomla is choosing the one located at the root of the server instead of the php.ini file located at the root of the IP.....
Joomla is not choosing the php.ini. Also as I said before local php.ini files are not always recursive. To check if the values in the local php.ini are being honoured look at their values in "system" --> "system information" --> "PHP information"
Webdongle wrote:If you look at the 'Loaded Configuration File' you will see the location of main php.ini file. If you look further down you will see two headings ... one is the Local value the other is the Master value. The former will show differently if you have a local php.ini file (or changed settings in the .htaccess).
Also see http://www.webhostinghub.com/help/learn ... -recursive
search google for
php.ini recursive
and
allow_url_fopen htaccess

Is the reseller Hosting package that you have managed by the Host or are you trying to manage it yourself ?
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

AlohaYoga
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 104
Joined: Sat Jul 23, 2016 4:03 pm

Re: change php.ini location

Post by AlohaYoga » Fri Nov 24, 2017 12:22 am

Thanks I will look up php.ini recursive and yes it is a server managed by a Host.

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44093
Joined: Sat Apr 05, 2008 9:58 pm

Re: change php.ini location

Post by Webdongle » Fri Nov 24, 2017 12:53 am

Then you will need to ask them about what they allow with local php.ini files.
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

User avatar
leolam
Joomla! Master
Joomla! Master
Posts: 20652
Joined: Mon Aug 29, 2005 10:17 am
Location: Netherlands/ Germany/ S'pore/Bogor/ North America
Contact:

Re: change php.ini location

Post by leolam » Fri Nov 24, 2017 2:58 am

Joomla does not chooses the php.ini. Joomla uses the directives as given in your php.ini so simply the php.ini as loaded by your host is wrong. Connect with your hosting provider

Leo 8)
Joomla's #1 Professional Services Provider:
#Joomla Professional Support: https://gws-desk.com -
#Joomla Specialized Hosting Solutions: https://gws-host.com -

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 30937
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: change php.ini location

Post by Per Yngve Berg » Fri Nov 24, 2017 7:49 am

Sorry, did not understood what you meant by "multiple IP". The term you are looking for is "Virtual Hosts", where each site have it's own Web Root.

AlohaYoga
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 104
Joined: Sat Jul 23, 2016 4:03 pm

Re: change php.ini location

Post by AlohaYoga » Fri Nov 24, 2017 1:08 pm

Thanks everyone. I contacted my host.
Per Yngve Berg wrote:Sorry, did not understood what you meant by "multiple IP". The term you are looking for is "Virtual Hosts", where each site have it's own Web Root.
Yes, I should have said VPS. :)

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 30937
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: change php.ini location

Post by Per Yngve Berg » Fri Nov 24, 2017 1:22 pm

Virtual Hosts is a feature of the Apache Web Server. It's configured in the apache.conf file. It's not the same as VPS.

AlohaYoga
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 104
Joined: Sat Jul 23, 2016 4:03 pm

Re: change php.ini location

Post by AlohaYoga » Mon Nov 27, 2017 12:48 pm

So... just to give the end result. it is currently not possible. Here is the message from my host:
https://forums.cpanel.net/threads/user- ... ng.605191/
"This was brought up as a part of internal case CPANEL-12426. The issue here is that" allow_url_fopen "is considered a global PHP configuration value, and thus enabling it on a per-domain basis is not allowed when it is disabled in the global PHP configuration file. "

therefore we believe that this is a problem directly with cPanel and in this case with suPHP.
Thanks for eveyone's contribution.

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44093
Joined: Sat Apr 05, 2008 9:58 pm

Re: change php.ini location

Post by Webdongle » Mon Nov 27, 2017 12:58 pm

Change Hosts
Enable and use allow_url_fopen to allow Joomla's One-Click-Update to work properly
https://docs.joomla.org/Security_Checkl ... _url_fopen
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".


Locked

Return to “General Questions/New to Joomla! 3.x”