Internal Server Error 500 after setting CORS settings

Hi,

I have a freshly installed DreamFactory 1.8.2 and it worked fine, until I saved the config-page after setting CORS- and E-Mail-settings. I clicked an the save button and got the loading spinner. This didn’t go away after about 30 seconds and then I hit F5 to reload. Since this event, the whole DSP doesn’t load anymore, giving me (and every other user) a 500 error with the following Error Details (and a avery long var_dump():

json_decode() expects at most 3 parameters, 4 given

and the topmost trace entry:

(
    [file] => /opt/dreamfactory/platform/vendor/dreamfactory/php-utils/src/JsonFile.php
    [line] => 224
    [function] => json_decode
    [args] => Array
        (
            [0] => [
                {
                  "host" : "*",
                  "is_enabled" : true,
                  "verbs" : [
                    "GET",
                    "POST",
                    "PUT",
                    "PATCH",
                    "MERGE",
                    "DELETE"
                  ]
                }
            ]
            [1] => 1
            [2] => 512
            [3] => 0
        )

)

So for now, I cannot access my DSP anymore. Any ideas to get it back to work? Do you need more information?

Greets,
spackmat

Ah, my server admin fixed it by patching the JsonFile.php, because the server is still running PHP 5.3. :confused:

What is the PHP version requirement for Dreamfactory? I didn’t find any on a quick research. Symfony has PHP 5.3.3 as a minimum requirement, but DreamFactory uses some PHP 5.4 stuff here and there.

I don’t believe we have any dependencies on PHP 5.4. However, all of 5.3.x was deprecated back in August, so upgrading to 5.4 is a good idea in general.

Hi, at least, there is a dependency on the JSON-handling in PHP 5.4 inside the file JsonFile.php causing the error mentioned above. There were a few other things like calling $object[‘property’] instead of $object->property in a file, I don’t remember, because my admin patched it and mentioned it only on the phone.

Now we have PHP 5.4 running and all those errors disappeared. This should be pointed out in the documentation.

Sorry for not updating this thread, but last month I did update the documentation.

https://github.com/dreamfactorysoftware/dsp-core/wiki/Additional-Drivers#php