0

I have a PHP html script which load the autoloaded libraries from composer:

<?php
require_once "vendor/autoload.php";
?>

<html>
    <body>
        Test
    </body>
</html>

When i'm browsing to this file using Chrome - I see nothing (the file is in Apache's /var/www folder)

When i'm running CLI php index.php I get the following output:

<html>
    <body>
        Test
    </body>
</html>

When i'm commenting out the require_once line - I see the html in the browser.

This make me things that something in the libraries i'm loading is breaking the code.

I can't understand why I see the full page in CLI and not in the browser...

What can cause that?

Bakalash
  • 463
  • 2
  • 5
  • 14
  • You change the line where you load the autoloader to `require __DIR__."/vendor/autoload.php";` as the web server process may have issues choosing the right file to include when using relative paths. – xabbuh Feb 29 '16 at 09:35
  • Also, turn on error reporting in your development environment to see the actual error message instead of a white page. – Jakub Zalas Feb 29 '16 at 09:44

1 Answers1

0

Found the problem. i look in the Apache logs and fount that the memory_limit is to low. I changed the memory_limit from 128mb to 536870912 and it solved the problem

Bakalash
  • 463
  • 2
  • 5
  • 14
  • 1
    O_O You need more than 128MB just to load the autoloader...!? – deceze Feb 29 '16 at 10:22
  • 1
    536870912mb? The F... O_o. You may want to look into the autoloader FYI. It *will* cause more issues if it requires more than 128mb – Sevvlor Feb 29 '16 at 10:29