Skip to content

Instantly share code, notes, and snippets.

@pvm-77
Created April 11, 2023 07:16
Show Gist options
  • Save pvm-77/ecec8b46bb0989c740d39cb8127192e6 to your computer and use it in GitHub Desktop.
Save pvm-77/ecec8b46bb0989c740d39cb8127192e6 to your computer and use it in GitHub Desktop.
How to edit your PHP configuration file (php.ini) in VS Code on Ubuntu

To edit your PHP configuration file (php.ini) in VS Code on Ubuntu, you can follow these steps:

  1. Open a terminal window on your Ubuntu machine.
  2. Navigate to the directory where the php.ini file is located. You can do this by running the following command:
     cd /etc/php/7.4/apache2/

Replace "7.4" with your PHP version number, and "apache2" with your web server name if you are using a different web server.

  1. Open the php.ini file in VS Code by running the following command:
      code php.ini

This assumes that you have already installed the "code" command to launch VS Code from the terminal. If you haven't done this yet, you can follow the instructions in the VS Code documentation.

  1. Make the necessary changes to the php.ini file, such as updating the "upload_max_filesize" and "post_max_size" directives.

  2. Save the changes to the file.

  3. Restart your web server to apply the changes. You can do this by running the following command:

      sudo systemctl restart apache2

    Replace "apache2" with your web server name if you are using a different web server.

After making these changes, you should be able to upload files larger than the default maximum file size limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment