Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

SarahS's avatar
Level 12

Herd php.ini question

Does anyone use Herd? I have installed it to try on a new machine and it was all going fine. I'm trying to get an app working that has a form where I upload a few files that can be up to about 20mb in size. I get an error:

Warning: POST Content-Length of 8985409 bytes exceeds the limit of 8388608 bytes in Unknown on line 0

So I checked the php.ini that the app was using and it has an upload limit of 8mb which makes sense in terms of the error.

But the Herd php.ini file is 24mb. So how do I get my app to reference the Herd php.ini? I thought it would do that already.

0 likes
6 replies
LaryAI's avatar
Level 58

It sounds like your application is not using the php.ini file provided by Herd, but rather a different one. To ensure that your application uses the correct php.ini file, you can follow these steps:

  1. Locate the Correct php.ini File: First, you need to confirm the location of the php.ini file that Herd is using. You can do this by creating a simple PHP file with the following content and navigating to it in your browser:

    <?php
    phpinfo();
    ?>
    

    Look for the "Loaded Configuration File" in the output. This will tell you which php.ini file is being used by Herd.

  2. Update the Correct php.ini File: Once you've located the correct php.ini file, you need to update the following directives to allow for larger uploads:

    upload_max_filesize = 24M
    post_max_size = 24M
    

    Make sure to set post_max_size to a value equal to or larger than upload_max_filesize.

  3. Restart the Web Server: After making changes to the php.ini file, you will need to restart your web server for the changes to take effect. The command to restart the server depends on the server you are using (e.g., Apache, Nginx, etc.).

    For example, if you are using Apache, you might use:

    sudo service apache2 restart
    

    Or if you are using Nginx:

    sudo service nginx restart
    
  4. Verify the Changes: After restarting the server, revisit the PHP file with phpinfo(); and check if the "Loaded Configuration File" is now pointing to the correct php.ini file and that the upload_max_filesize and post_max_size values have been updated.

If after following these steps your application is still not using the correct php.ini file, you may need to specify the path to the php.ini file directly in your web server's configuration or use a .user.ini file in your project directory with the necessary configurations.

Remember that the exact steps may vary depending on your specific server setup and how Herd is configured on your machine. If you continue to have issues, you may want to consult the Herd documentation or reach out to their support for more detailed guidance.

gmgarrison's avatar

I wish I had an answer but I can say that I'm experiencing the same behavior. I've tried adding Xdebug and changing the memory limit in the file that's specified in phpinfo() but neither of those changes get picked up after restarting.

I'm doubly-confused because I do get Xdebug support on the command line.

Snapey's avatar

There is a box on the php page of the settings where you can change the upload size.

Change this, then restart Herd Services (from the dropdown)

Anaxarchos's avatar

@Snapey There you can only change the value for the memory_limit and the upload_max_filesize. I want to upload files bigger then 8MB and so I had to change the post_max_size as well. This could be done in the Herd/config/fpm/8.3-fpm.conf file.

1 like
gmgarrison's avatar

For the record, my issue was multiple php-fpm instances running (from Homebrew) and so restarting Herd didn't actually pick up any changes in the php.ini file. I cleared those and rebooted and was back in business. Good luck!

Snapey's avatar

This just helped me

You may force a restart of all Herd services by clicking on the Herd icon in the menu bar and holding the option key ⌥. This will change the Stop all menu item to Force stop all. Click on it to forcefully stop all Herd services, and then click on Start all to restart them.

4 likes

Please or to participate in this conversation.