LSPHP is a PHP handler that combines mod_lsapi+PHP. LSPHP provides an opportunity to use server-level caching and ensures better performance.
It offers excellent PHP performance, a low memory footprint coupled with great security and support for opcode caching.
NOTE: This directive is required only for Apache servers.
For the settings from the chosen php.ini file to work, a specific directive should be added to your .htaccess file:
lsapi_phpini /home/USER/public_html/php.ini
NOTE: Make sure you replace USER with your cPanel username. By default, public_html is the root folder for the main domain. In case you want to change the LSPHP directive for a subdomain/an addon domain, replace public_html with the corresponding root folder.
This option specifies which path to pass on to the PHP-interpreter and which folder to execute php.ini from.
Follow the instructions below to proceed with the setup.
1. To add these lines to .htaccess file, go to cPanel >>
Files section >>
File Manager menu:
![](https://Namecheap.simplekb.com/SiteContents/2-7C22D5236A4543EB827F3BD8936E153E/media/file1.1.png)
2. Navigate to public_html directory:
![](https://Namecheap.simplekb.com/SiteContents/2-7C22D5236A4543EB827F3BD8936E153E/media/pl_file_manager_4.png)
3. Click on
Settings in the right top corner and enable
Show Hidden Files (dotfiles) in the pop-up window, which will allow you to see .htaccess file:
![](https://Namecheap.simplekb.com/SiteContents/2-7C22D5236A4543EB827F3BD8936E153E/media/pl_file_manager_5.png)
![](https://Namecheap.simplekb.com/SiteContents/2-7C22D5236A4543EB827F3BD8936E153E/media/pl_file_manager_6.png)
4. If there is no .htaccess file in the document root, you need to create it using
+File option:
![](https://Namecheap.simplekb.com/SiteContents/2-7C22D5236A4543EB827F3BD8936E153E/media/pl_suphp_2.png)
![](https://Namecheap.simplekb.com/SiteContents/2-7C22D5236A4543EB827F3BD8936E153E/media/pl_suphp_3.png)
5. Right-click on .htaccess file >>
Edit or use
Edit option located in the toolbar:
![](https://Namecheap.simplekb.com/SiteContents/2-7C22D5236A4543EB827F3BD8936E153E/media/pl_suphp_1.png)
6. Add the lines provided below into .htaccess file and
Save Changes.
lsapi_phpini /home/USER/public_html/php.ini
![](https://Namecheap.simplekb.com/SiteContents/2-7C22D5236A4543EB827F3BD8936E153E/media/pl_suphp_4.1.png)
If you have done it right, the designed php.ini will take immediate effect.
7. If you need to load php.ini for/from subdirectory, make sure you edit
ConfigPath accordingly.
That's it!
Need any help? Contact our
Helpdesk