Activating php extension from php file

I have an apache / php - WINDOWS server. I have 2 different sites (www.example.com and test.example.com) I used vhosts to configure my subdomain.

Can I upload different php.ini files for each subdomain? I have a problem with the first site that comes from using the extension for the second site. Therefore, I need to enable it for the second ONLY or disable it only for the first.

+4
source share
3 answers

You cannot activate php extension from php file. You can check the download of only a specific file.

+1
source

Extensions can be enabled programmatically in some SAPIs using

Read the safety and compatibility guide carefully.

For more options, see

+1
source

Many settings in php.ini can be overridden in the .htaccess file or in the executable script itself. Take a look at the list: http://us3.php.net/manual/en/ini.list.php and refer to the Changeable column for more details.

If by extension you mean the php extension, then no, you cannot have another php extension on the same server, because php is shared. The only way you could do this is to start the 2nd Apache server. If this is really a test site, a separate server will be possible, because you can run it on a separate port, but I would not suggest taking this route if you were not confident in your skills as a Windows system administrator.

0
source

Source: https://habr.com/ru/post/1369445/


All Articles