Configure file uploading on PHP

 

PHP stores most of its settings in the php.ini file. You will have to edit this file with a simple text editor to check (and enable if necessary) file uploads. To find out where the php.ini file is located, follow the next steps:

  1. Create a new file that can be accessed from the browser (place it inside the web server's document root). For the file extension use php

  2. In the file enter the following code: (the phpinfo function will display all information available on the existing PHP installation)
    <?php
    phpinfo();
    ?>

  3. Save the file and close it. Then access it from a browser. The page will display various information concerning the PHP options.

  4. The location of the php.ini file is displayed in the first rows:


     

Navigate to the location displayed and open the php.ini file using a text editor. There are two options that control the file upload: one to enable or disable it globally, and one that sets the maximum size for uploaded files. In order to make sure the file uploading capabilities of KTML4 will work, you must:

  1. Check that the file_uploads setting is set to ON. You can find this line by searching in the php.ini file. If it is not set to ON, you will have to change the setting. The final form must be:

    ; Whether to allow HTTP file uploads.
    file_uploads = On

     

  2. The second setting controls the maximum size of files to upload. By default, PHP sets this limit to 2 megabytes. You can find this setting after the first one. It should read:

    ; Maximum allowed size for uploaded files.
    upload_max_filesize = 2M

     

  3. Change this setting to whatever size you need.

  4. Save the file and close it. For the changes to take effect you must restart your web server.