• GoDaddy Community
  • VPS & Dedicated Servers
  • VPS & Dedicated Servers

    cancel
    Showing results for 
    Show  only  | Search instead for 
    Did you mean: 
    Helper II

    How do I change PHP settings on my server?

    How do you change your server's PHP settings?

    3 REPLIES 3
    Employee

    If you have root access to the server you can modify the php initialization file. If you don't have root access you can create a php initialization file and upload it to the document root of the site/hosting  account you want to configure. The name of the file depends on your server. You can find more info on php's website. php.net

    "The only standing between you and your goals is you."
    -Somebody

    If you're on standard linux hosting, the name of the file is php.ini.

     

    If your needs are specific to a single file, there is a PHP directive that changes settings for a single script.  You can use ini_set to set specific configuration settings like 

    ini_set('memory_limit', "256M");
    ini_set('max_execution_time', 300);
    ini_set('upload_max_filesize', '10M');

     This is often preferable to making sitewide changes. 

    Keep on Coding!
    Mark Cicchetti - There are 10 kinds of people... those who understand binary and those who don't.

    If you have a dedicated server, there is another (somewhat complex) way to go about it through the WHM.

    I just had to do this last night.  I had a piece of software that relied on the mb_internal_encoding function which isn't installed by default on the dedicated servers.

    Here's what I did...  

    1. Log in to WHM as the 'root' user.
    2. In the Find box type easy.
    3. Click EasyApache (Apache Update).
    4. Leave default, and then click the gear icon (Customize Profile).
    5. Leave default, and then click Next Step.
    6. Click Exhaustive Options List.
    7. Click the name of the Apache or PHP module, and then click Save and build.

    You'll need to restart Apache after this so you'll have a few seconds of downtime but this added the missing module and now the software is happy.

    Another option is the PHP Configuration Editor (in the find box, type PHP and choose if from the filtered list).  The basic mode gives access to things like max execution time and memory limit.  The advanced mode accesses quite a few options, many of which you don't want to mess with unless you know what you're doing.

    Keep on Coding!
    Mark Cicchetti - There are 10 kinds of people... those who understand binary and those who don't.