Php.ini file location?

Adding the custom php.ini to the root folder doesn’t seem to have much effect on the system. Should it be placed in the public folder or somewhere else instead than the root to work? (We’re using Apache by the way).

The reason we are doing this is that invoice Ninja is reporting that the open_basedir isn’t set.

open_basedir = ${open_basedir} ":path-to-public_html" in custom php.ini file…

Thanks in advance.
Kind regards

@david do you have any thoughts on this?

I’m not sure, it depends from system to system

I believe running php --ini should show the path of the loaded .ini file.

One shared hosting this could be different again

I’m running my own Linux /ubuntu server with php 8 (VPS), so it is not shared hosting.
I tested and added the .ini file in public folder too, but to no avail as it didn’t do anything.

Kind regards

As mentioned above, run php --ini

and edit that .ini file to make any changes needed and it should be reflected correctly.

You mean the main/core php.ini file right?

Kind regards

Hi @david
I mean I know the loaded path which is the default php.ini file in etc/ … apache2/… php.ini

But it is better (at least from what i learned and for a security stand point), to use a local php for the website than mess around with the global php.ini but as you know that one does not load. Hence why I asked for if the php.ini needs to be placed somewhere special in the Invoice Ninja folder hierarchy…

Kind regards

It doesn’t matter as far as invoice ninja is concerned. You’ll just need to configure apache to detect the different php.ini

@david I guess the OP meant user.ini , not php.ini

Correct. The custom php file in the www root which you use to override the main/core php.ini