---
title: "Edit PHP files — .user.ini, nexinfo.php, and php.ini files"
source: "https://docs.nexcess.com/sites-stores/managed-woocommerce/store-management/modify-php-values/"
description: "Scripts running on your website hosted with Nexcess may require more resources, so you may want to edit PHP files or adjust PHP settings in other ways — or enli…"
vertical: "Sites & Stores"
date: "2023-06-23"
last_modified: "2026-06-30"
---

# Edit PHP files — .user.ini, nexinfo.php, and php.ini files

Any application using the **Hypertext Preprocessor (PHP) platform** in its programming language uses the [**php.ini file as its default configuration file**](https://www.php.net/manual/en/configuration.file.php). If done correctly, admin users can edit PHP files to change system variables such as file timeouts, resource limits, and upload sizes — among other variables found in the existing PHP settings files.

## Getting starting when you need to edit PHP files

Sometimes, scripts running on your websites may require more resources than what is available by default. We will show you how to modify the PHP settings file or files as necessary to ensure your websites function correctly. This kind of modification involves your capability to edit PHP files.

### Nexcess default PHP limits

Per website hosted with us, [**PHP settings file’s default limits**](https://www.nexcess.net/help/php-ini-default/) are set high enough on all cloud hosting plans to ensure normal website functionality works as expected. Nexcess uses the following standard PHP configuration:

- **max\_execution\_time 600**
- **max\_file\_uploads 1024M**
- **max\_input\_vars 16384**
- **memory\_limit 2048M**
- **post\_max\_size 1536M**
- **upload\_max\_filesize 1536M**

### Creating a phpinfo file to output the PHP limits currently configured

It is important to note that the PHP information files created by following the guidance in this section should always be removed and not left on the server after testing.

You can check PHP limits used on your site simply by [**creating a phpinfo file**](https://www.php.net/manual/en/function.phpinfo.php) named **nexinfo.php** within the document root directory on your site. It only requires one snippet of code within the file to call on the **phpinfo()** function, and you can add it by running a simple command from your site’s document root directory:

```
echo "?php phpinfo(); ?" >> nexinfo.php
```

You can then access the **phpinfo** page through your main domain (for example, **https://domain.com/nexinfo.php**). After reviewing this particular PHP settings file, we advise that you permanently delete the **phpinfo** file (for example, the **nexinfo.php** file you just created in the steps above) from your site.

## Adjusting PHP limits via the wp-config.php PHP settings file

Before modifying the PHP limits in the **wp-config.php** file, create a backup of the original file. Then, add directives like the following:

```
define('WP_MEMORY_LIMIT', '128M');
```

Note that for sites running WooCommerce, we recommend setting the [**PHP memory limit to at least 256M**](https://woocommerce.com/document/increasing-the-wordpress-memory-limit/).

You should be done once you save the file. If you’re still getting the fatal error message, you may need to increase it further. To increase the admin area’s memory limit, you’ll need to add a directive similar to this:

```
define( 'WP_MAX_MEMORY_LIMIT', '256M' );
```

## Edit PHP files to modify PHP limits for Magento-based websites

You can modify PHP limits for Magento in the **.user.ini** and **.htaccess** files.

### Adjusting PHP limits via the .htaccess and .user.ini PHP settings files

Both of these may be included in the website’s document root directory. Multiple **.htaccess** and **.user.ini** files may exist in various directories within the Magento installation. You should use the lowest applicable restrictions here, and caution is always advised because the directions within them may conflict with one another.
