I have a script that is uploading pictures from text boxs it resizes the pictures. It also some text boxs that info gets put in a database. When I try to upload larger pictures it either gives me the page cannot be displayed page or it tells me the script exceded 90 second exacution time or somthing to that sort. 4 picture upload boxs total.

anyone have any ideas on how to fix this?

any help would be great!

    Depending on what kind of access you have to the server, you may or may not be able to fix this.

    If safe mode is on, then the only way to do this is through the Virtual Host configuration for your domain, or using .htaccess, etc. If you do not have access to such things, and safe mode is off, then you can use the set_time_limit() function (link below).

    http://ca3.php.net/function.set-time-limit

    Hope that helps.

    -Percy

      Fatal error: Maximum execution time of 90 seconds exceeded in c:\websites\blah\blah\admin\add.php on line 2

      failing at line 2 line 2 is where i have set_time_limit(60); php has safe mode off and i dont have access to the php.ini file

        Sorry, I forgot one thing.

        Uploading files is done before the PHP script is executed. That means that the timeout is not reached until the files are completely uploaded. However, the PHP timer is started when the files start uploading.

        For this reason, it has to be changed in php.ini, or in .htaccess.

        Sample .htaccess file:

        php_value max_execution_time 300
        

        This will set it to 300 seconds (5 minutes). Put the .htaccess file in the same folder as the script, and it should work.

        Hope that helps

        -Percy

          hum,

          well I am on windows server so no .htaccess. ill ask my host if he can raise the time limet in the php.ini file thanks thought you've been a great help

            hum,

            fixed the error of the max execution time with

            $set_time = ini_set("max_execution_time", 300);

            but, if i try to upload a 3 pictures that are around 130kb each i get "the page cannot be displayed" page anyone know why it would do this?

              sure you can have a .htaccess

              Follow:
              open command prompt (start -> run "command")
              go to the dir (c:\web)
              type:
              edit .htaccess

              write some text in there

              then save and close the file
              BAM you have .htaccess

              you can edit it with notepad and everything 🙂

                Not my server just have hosting. this is the email i got when i asked about .htaccess

                Our Windows 2000 servers do not support the .htaccess files.

                Let us know if you have any questions.

                  PHP on Windows just isn't anywhere near the quality of PHP on Linux.

                  Unless you are stuck with that hosting company, I would seriously considering hosting on a Linux-based server. I thoroughly enjoy this company:

                  http://www.globalcon.net/

                  Unbeatable service at an amazing price.

                  -Percy

                    Write a Reply...