Php.ini

From Hostek.com Wiki
Revision as of 14:55, 20 September 2016 by Seanc (Talk | contribs)

Jump to: navigation, search


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 functions enabled, 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. 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.
  4. 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