Reputation: 1783
I wanted to dd('string')
but it's returning error 500. My error_log is:
strpos(): Empty needle {"exception":"[object] (ErrorException(code: 0): strpos(): Empty needle at /vendor/symfony/var-dumper/Dumper/ContextProvider/SourceContextProvider.php:101)
Only dd
and dump
not working, not other helper functions. it was working properly on local but when I uploaded it to the server it won't anymore, I guess the problem is from php-fpm
maybe as this stack link mentions.
How can I figure out where the problem is from?
Upvotes: 2
Views: 2572
Reputation: 21493
looks like a bug in Symfony's VarDumper component
, in /vendor/symfony/var-dumper/Dumper/ContextProvider/SourceContextProvider.php
near line 101, replace
if (null !== $this->projectDir) {
$context['project_dir'] = $this->projectDir;
if (0 === strpos($file, $this->projectDir)) {
$context['file_relative'] = ltrim(substr($file, \strlen($this->projectDir)), \DIRECTORY_SEPARATOR);
}
}
with
if (isset($this->projectDir) && is_string($this->projectDir) && strlen($this->projectDir) > 0) {
$context['project_dir'] = $this->projectDir;
if (0 === strpos($file, $this->projectDir)) {
$context['file_relative'] = ltrim(substr($file, \strlen($this->projectDir)), \DIRECTORY_SEPARATOR);
}
}
that should fix it.
someone should also file a bugreport so it gets fixed upstream.
Upvotes: 2