How to DirectAdmin – Manage PHP Variables

Contents

    This article applies only to Packetra account holders. It assumes you already logged into DirectAdmin. Don’t have a hosting account yet? Check out our Shared Hosting or WordPress Hosting. Already have one? Log in to your portal. Click the DirectAdmin hosting service, then click the “Log in to DirectAdmin” button on the content page to follow the guide below.

    Find the System Info & Files Section

    First, open the System Info & Files dropdown in the Control Panel navigation. Select the File Manager button.

    FileManager Opens

    You will be redirected to your DirectAdmin File Manager, this is where you manage files for your domain/s.

    Locate your Public_HTML Directory

    Traverse by selecting domains > [your domain] > public_html on the left panel. This is where your website files live, and where a .user.ini placed here will apply to the whole site.

    Create the .user.ini File

    From the blue top panel, click New File. Name it .user.ini (note the leading dot) and confirm. The new file will appear in your public_html directory.

    FileManager showing a file .user.ini which you can use to edit the PHP variables.

    Add Your PHP Directives

    Select the .user.ini file and open it in the editor. Add the settings you want to change, one per line. For example:

    memory_limit = 512M
    upload_max_filesize = 128M
    post_max_size = 128M
    max_execution_time = 300
    max_input_time = 300
    max_input_vars = 5000

    Save the file. Your changes take effect within a few minutes. PHP caches .user.ini files (300 seconds by default), so there may be a short delay before the new values are live.

    Check Your Configuration with phpinfo (Optional)

    To confirm your changes applied, create a file named phpinfo.php in public_html and add the following line:

    <?php phpinfo(); ?>

    Now visit [yourdomain.tld]/phpinfo.php in your browser to see your full active PHP configuration, including the values you just set. Delete this file once you are finished, as it exposes server details that should not be left public.

    That is it, you now know how to manage your PHP settings with a .user.ini file.

    Frequently Asked Questions

    Where should the .user.ini file go?
    Place it in your domain’s public_html folder to apply settings site-wide. You can also drop a .user.ini into any subfolder to apply settings to just that directory.

    My change is not taking effect. Why?
    PHP caches .user.ini for about 300 seconds, so wait a few minutes and reload. If a setting still won’t apply, it may be one that can’t be changed at this level, such as directives that are locked to the system configuration.

    Do I need to restart anything?
    No. Save the file and the changes are picked up automatically once the cache refreshes.

    Good to Know
    A .user.ini file only controls per-directory and per-user PHP directives, so common settings like memory_limit, upload_max_filesize, post_max_size, and the max_* limits work well here. Placing the file in a subdirectory scopes those settings to that folder only, which is handy for a single app. Always remove any phpinfo.php file after you’ve checked your configuration. Run into any issues? Open a support ticket through the client portal and our team will help you.

    Updated on September 21, 2026
    Was this article helpful?