Closed jakubtobiasz closed 3 years ago
I've performed some investigation and I've found what's causing the problem. Symfony load's the autoload_runtime.php
file in which is executed $app = require $_SERVER['SCRIPT_FILENAME'];
. It tries to load the server.php
once again and throws the fatal error.
I've found also some workaround by putting the $_SERVER['SCRIPT_FILENAME'] = $frontControllerPath;
just before require $frontControllerPath;
in the server.php
.
It seems it works but I have no idea if it may cause the some unexpected bugs. I've checked out on Wordpress, Symfony 5 and Sylius (the framework based on the Symfony 5.3) and it works. Anybody has any idea if it's a good idea to follow my solution?
Just to add that I'm seeing this error:
Fatal error: Cannot redeclare get_valet_site_path() (previously declared in /Users/tdewit/.composer/vendor/laravel/valet/server.php:128) in /Users/tdewit/.composer/vendor/laravel/valet/server.php on line 128
$_SERVER['SCRIPT_FILENAME'] = $frontControllerPath;
I can verify that this workaround works for my Symfony 5.3.3 "fresh" application.
Clear description of your problem
After the setting up the clear Symfony project I'm getting
Expected behavior
It should display the 'Welcome to Symfony!' page.
Current behavior
It throws the error
Steps to Reproduce
If you have the symfony cli
symfony new myproj
valet link
myproj.test
in the webbrowserDiagnosis
sw_vers
valet --version
cat ~/.config/valet/config.json
cat ~/.composer/composer.json
composer global diagnose
composer global outdated
ls -al /etc/sudoers.d/
brew config
brew services list
brew list --formula --versions | grep -E "(php|nginx|dnsmasq|mariadb|mysql|mailhog|openssl)(@\d\..*)?\s"
brew outdated
brew tap
php -v
which -a php
php --ini
nginx -v
curl --version
php --ri curl
~/.composer/vendor/laravel/valet/bin/ngrok version
ls -al ~/.ngrok2
brew info nginx
brew info php
brew info openssl
openssl version -a
openssl ciphers
sudo nginx -t
which -a php-fpm
/usr/local/opt/php/sbin/php-fpm -v
sudo /usr/local/opt/php/sbin/php-fpm -y /usr/local/etc/php/8.0/php-fpm.conf --test
ls -al ~/Library/LaunchAgents | grep homebrew
ls -al /Library/LaunchAgents | grep homebrew
ls -al /Library/LaunchDaemons | grep homebrew
ls -al /Library/LaunchDaemons | grep "com.laravel.valet."
ls -aln /etc/resolv.conf
cat /etc/resolv.conf
ifconfig lo0
sh -c 'echo "------\n/usr/local/etc/nginx/valet/valet.conf\n---\n"; cat /usr/local/etc/nginx/valet/valet.conf | grep -n "# valet loopback"; echo "\n------\n"'
sh -c 'for file in ~/.config/valet/dnsmasq.d/*; do echo "------\n~/.config/valet/dnsmasq.d/$(basename $file)\n---\n"; cat $file; echo "\n------\n"; done'
sh -c 'for file in ~/.config/valet/nginx/*; do echo "------\n~/.config/valet/nginx/$(basename $file)\n---\n"; cat $file | grep -n "# valet loopback"; echo "\n------\n"; done'