Search code examples
phpapachelamp

Loading php extension for specific domain only


I have a dedicated LAMP server with more than one domains hosted. I want to load a php extension only for a single domain. Is it possible?


Solution

  • Edit your VirtualHost configuration.

    Make a copy of php.ini file. Add the extension you need in there. Store it in separate directory.

    Use PHPIniDir in your config for the particular site and point to that new dir, containing new php.ini

    Restart apache.

    Your config will be loaded and will use separate php.ini file.