Two exceptions at startup

I just wanted to try grav by copyying the “Grav Base Files” to my webspace. There were two issues when I tried to load the web page.

  1. An exception at problems.php at the following lines:
    // delete any exising validated files
    foreach (glob(CACHE_DIR . $validated_prefix . ‘*’) as $filename) {
    unlink($filename);
    }
    It was something like "… invalid argument passed to foreach statement …"
    When I commented out the foreach statement a second exception occured:

  2. Whoops \ Exception \ ErrorException (E_WARNING)
    Cannot set max_execution_time above master value of 30 (tried to set unlimited)

I commented out line 298 (set_time_limit(0):wink: and so I was able to load the web page.

(The first issue (foreach…) didn’t show up again, when I uncommented the lines)

For explanations I would be very grateful!

It appears that you didn’t upload all the files.

If possible, and supported on your webhost, see if you can upload the Grav Base ZIP file to your host and then extract the entire file via your host control panel. Mosts hosts have this kind of capability. It will ensure that all files are uploaded properly.

The next best option is to upload an entire folder rather than selecting files manually.

If you cannot do this, try uploading your files again and ensure that all files (including hidden dot files (.htaccess, etc) are uploaded also.

thanks for your reply! I looked for all folders and files. All are totaly identical.
My webspace is hosted at alfahosting.de . They say following: “You can not set unlimited max execution time in a shared hosting environment” - So I think, I have got to modify this line to settime_limit(45) (because this is the biggest value, they allow)
But are there any side effects, when I do this?

Try commenting out the line. It shouldn’t have any ill effects.

FYI, i’ve replaced the glob() call in the problems plugin and also put some extra checks around the set_time_lime() that was tripping you up before. The next update should run a little smoother on your host that has those PHP functions restricted.