Syonix / monolog-viewer

A viewer to nicely display log files generated by monolog.
GNU General Public License v2.0
273 stars 67 forks source link

Blank page on PHP 7.0 #61

Open ivanstan opened 6 years ago

ivanstan commented 6 years ago

After setting up the config and password, blank page is shown on url /logs

Error in PHP log: Fatal error: Cannot use Syonix\Util\String as String because 'String' is a special class name in /var/www/html/dev/log/src/Syonix/LogViewer/Client.php on line 5

I might fork to add support for PHP7

pppdns commented 6 years ago

@ivanstan did you solve this? I ran into the same problem

ivanstan commented 6 years ago

No, unfortunately I didn't have time. Migrating to newer php version will be more than this one issue.

elliotboney commented 6 years ago

I tried updating dependencies thinking one of them probably had a new version that supported php7, got stuck with this error for now

Fatal error: Uncaught TypeError: Argument 1 passed to Symfony\Component\Debug\ExceptionHandler::handle() must be an instance of Exception, instance of Error given in /vendor/symfony/debug/ExceptionHandler.php:117 
Stack trace: #0 [internal function]: Symfony\Component\Debug\ExceptionHandler->handle(Object(Error)) #1 {main} thrown in /vendor/symfony/debug/ExceptionHandler.php on line 117
jlcd commented 6 years ago

Same issue here under php's bultin server (php -S):

127.0.0.1:62959 [200]: /logs - Cannot use Syonix\Util\String as String because 'String' is a special class name in /Users/jdrummond/Projects/monolog-viewer/src/Syonix/LogViewer/Client.php on line 5

Edit:

Installed php 5.6 and php56 -S works as expected.

vaclavgreif commented 6 years ago

Any update on this, please?

ivanstan commented 6 years ago

Looks like current HEAD on master is working on php-7.1

ghost commented 6 years ago

Any news for PHP 7.x ? It's really a problem for apps running with the new Symfony 4.x (require PHP 7.1)...

pppdns commented 6 years ago

@davidcancalon It works for me with PHP 7.1, what can you see in your error logs?

aleao-sl commented 6 years ago

I solved this by changing on src/Syonix/LogViewer/Client.php the following:

On line 5 From: use Syonix\Util\String;

To: use Syonix\Util\String as SyonixString;

And on line 28:

From $this->slug = String::toAscii($name); To: $this->slug = SyonixString::toAscii($name);

That's it