Difference between revisions of "Php.ini"

From Hostek.com Wiki
Jump to: navigation, search
m (Linux/cPanel VPS PHP.ini)
 
(4 intermediate revisions by 3 users not shown)
Line 16: Line 16:
 
#Check the Enable custom php.ini checkbox
 
#Check the Enable custom php.ini checkbox
 
*<b>Note</b> - You can also change many common settings used in your PHP.ini here
 
*<b>Note</b> - You can also change many common settings used in your PHP.ini here
 +
 +
==Linux/cPanel VPS PHP.ini==
 +
 +
This is if you need specific PHP Functions enabled/modified, and you don't have the feature to do this in your cPanel.
 +
 +
#Copy your <code>/usr/local/lib/php.ini</code> file to the domain's root folder.
 +
#*Example SSH Command: <code>cp /usr/local/lib/php.ini /home/cpusername/public_html</code>
 +
#*#'''Replace "cpusername" with the domain's actual cPanel username.'''
 +
#Make sure the file is owned by the domain's cPanel user.
 +
#*Example SSH Command: <code>chown cpusername:cpusername php.ini</code>
 +
#*#'''Replace "cpusername" with the domain's actual cPanel username.'''
 +
#*You should be able to reset the permissions on the PHP.ini file via your cPanel's File Manager feature too.
 +
#Add the following to the domain's .htaccess file: <code>SetEnv PHPRC /home/cpusername/public_html/php.ini</code>
 +
##'''Replace "cpusername" with the domain's actual cPanel username.'''
 +
#*You should be able to see this file through FTP and SSH by default.
 +
#**If you can't see the .htaccess file through the cPanel File Manager, you'll need to follow either of these steps depending on which cPanel Theme you have:
 +
#***Paper Lantern Theme
 +
#***#In File Manager click on '''Settings'''
 +
#***#Tick the '''Show Hidden Files (dotfiles)''' box
 +
#***#Click '''Save'''
 +
#***x3 Theme
 +
#***#Click on the '''File Manager''' button to be prompted for some options.
 +
#***#*If you aren't prompted for more options you'll need to click on "Reset All Interface Settings" at the very bottom of the page.
 +
#***#Tick the '''Show Hidden Files (dotfiles)''' box
 +
#***#Click '''Go'''
 +
#Edit the new PHP.ini file as you see fit.
 +
#*You can 'comment out' a line to disable a function by adding a Number Sign ('''#''') at the start of the line.
 +
  
 
[[Category:Tutorials]]
 
[[Category:Tutorials]]
 +
[[Category:Windows]]
 +
[[Category:Linux]]

Latest revision as of 14:59, 20 September 2016


Windows Custom PHP.ini

  1. Log into the Control Panel at wcp.hostek.com
  2. Click on PHP Settings
  3. Select the domain or subdomain you want to have a custom PHP.ini for
  4. There will be a checkbox that says 'Custom php.ini'
  5. Check this and it will create the Custom PHP.ini file for you.
  • Note - You can also change the PHP version that is used from the drop down menu.

Linux Custom PHP.ini

  1. Log into your control panel
  2. Click on PHP.ini Settings
  3. Check the Enable custom php.ini checkbox
  • Note - You can also change many common settings used in your PHP.ini here

Linux/cPanel VPS PHP.ini

This is if you need specific PHP Functions enabled/modified, and you don't have the feature to do this in your cPanel.

  1. Copy your /usr/local/lib/php.ini file to the domain's root folder.
    • Example SSH Command: cp /usr/local/lib/php.ini /home/cpusername/public_html
      1. Replace "cpusername" with the domain's actual cPanel username.
  2. Make sure the file is owned by the domain's cPanel user.
    • Example SSH Command: chown cpusername:cpusername php.ini
      1. Replace "cpusername" with the domain's actual cPanel username.
    • You should be able to reset the permissions on the PHP.ini file via your cPanel's File Manager feature too.
  3. Add the following to the domain's .htaccess file: SetEnv PHPRC /home/cpusername/public_html/php.ini
    1. Replace "cpusername" with the domain's actual cPanel username.
    • You should be able to see this file through FTP and SSH by default.
      • If you can't see the .htaccess file through the cPanel File Manager, you'll need to follow either of these steps depending on which cPanel Theme you have:
        • Paper Lantern Theme
          1. In File Manager click on Settings
          2. Tick the Show Hidden Files (dotfiles) box
          3. Click Save
        • x3 Theme
          1. Click on the File Manager button to be prompted for some options.
            • If you aren't prompted for more options you'll need to click on "Reset All Interface Settings" at the very bottom of the page.
          2. Tick the Show Hidden Files (dotfiles) box
          3. Click Go
  4. Edit the new PHP.ini file as you see fit.
    • You can 'comment out' a line to disable a function by adding a Number Sign (#) at the start of the line.