Код Visual Studio для PHP – нет такого файла или каталога ⇐ Php
-
Гость
Код Visual Studio для PHP – нет такого файла или каталога
I'm able to execute a PHP script in Dreamweaver (under WAMP) but not Visual Studio Code using the PHP Server extension. I'm trying to move off Dreamweaver. In Visual Studio I have an error when calling the script or its location.
Using Wampserver 3.2.5
My Apache httpd.conf Define INSTALL_DIR c:/wamp64 DocumentRoot "${INSTALL_DIR}/www" test.php in folder C:\wamp64\www\Games\netplaybaseball.com\
Using Visual Studio 1.87.0
Settings Ip: localhost PHP Path: empty (using $PATH environment variable which is set to C:\wamp64\bin\php\php7.4.16) Port: 8000 Relative Path: empty I have installed all the necessary extensions to use PHP within Visual Studio.
In Dreamweaver, site setting:
Local Site Folder: C:\wamp64\www\Games\netplaybaseball.com\ Web URL: http://localhost/Games/netplaybaseball.com/ When executing the code under Dreamweaver (using WAMP), it successfully runs. URL is http://localhost/Games/netplaybaseball.com/test.php
With WAMP still running, when executing test.php in Visual Studio, I get this Output:
[Sun Mar 3 11:31:44 2024] PHP 7.4.16 Development Server (http://localhost:80) started [Sun Mar 3 11:31:44 2024] [::1]:56426 Accepted [Sun Mar 3 11:31:44 2024] [::1]:56427 Accepted [Sun Mar 3 18:31:44 2024] [404] /wamp64/www/Games/netplaybaseball.com/test.php - No such file or directory [Sun Mar 3 11:31:44 2024] [::1]:56426 [404]: GET /wamp64/www/Games/netplaybaseball.com/test.php - No such file or directory [Sun Mar 3 11:31:44 2024] [::1]:56426 Closing [Sun Mar 3 11:33:19 2024] [::1]:56427 Closed without sending a request; it was probably just an unused speculative preconnection [Sun Mar 3 11:33:19 2024] [::1]:56427 Closing The URL is http://localhost/wamp64/www/Games/netpl ... m/test.php, and page displays:
Not Found The requested resource /wamp64/www/Games/netplaybaseball.com/test.php was not found on this server. How do I get Visual Studio to execute the correct location?
I've tried different Visual Studio settings but no luck. Or I'm missing the simple answer.
Источник: https://stackoverflow.com/questions/780 ... -directory
I'm able to execute a PHP script in Dreamweaver (under WAMP) but not Visual Studio Code using the PHP Server extension. I'm trying to move off Dreamweaver. In Visual Studio I have an error when calling the script or its location.
Using Wampserver 3.2.5
My Apache httpd.conf Define INSTALL_DIR c:/wamp64 DocumentRoot "${INSTALL_DIR}/www" test.php in folder C:\wamp64\www\Games\netplaybaseball.com\
Using Visual Studio 1.87.0
Settings Ip: localhost PHP Path: empty (using $PATH environment variable which is set to C:\wamp64\bin\php\php7.4.16) Port: 8000 Relative Path: empty I have installed all the necessary extensions to use PHP within Visual Studio.
In Dreamweaver, site setting:
Local Site Folder: C:\wamp64\www\Games\netplaybaseball.com\ Web URL: http://localhost/Games/netplaybaseball.com/ When executing the code under Dreamweaver (using WAMP), it successfully runs. URL is http://localhost/Games/netplaybaseball.com/test.php
With WAMP still running, when executing test.php in Visual Studio, I get this Output:
[Sun Mar 3 11:31:44 2024] PHP 7.4.16 Development Server (http://localhost:80) started [Sun Mar 3 11:31:44 2024] [::1]:56426 Accepted [Sun Mar 3 11:31:44 2024] [::1]:56427 Accepted [Sun Mar 3 18:31:44 2024] [404] /wamp64/www/Games/netplaybaseball.com/test.php - No such file or directory [Sun Mar 3 11:31:44 2024] [::1]:56426 [404]: GET /wamp64/www/Games/netplaybaseball.com/test.php - No such file or directory [Sun Mar 3 11:31:44 2024] [::1]:56426 Closing [Sun Mar 3 11:33:19 2024] [::1]:56427 Closed without sending a request; it was probably just an unused speculative preconnection [Sun Mar 3 11:33:19 2024] [::1]:56427 Closing The URL is http://localhost/wamp64/www/Games/netpl ... m/test.php, and page displays:
Not Found The requested resource /wamp64/www/Games/netplaybaseball.com/test.php was not found on this server. How do I get Visual Studio to execute the correct location?
I've tried different Visual Studio settings but no luck. Or I'm missing the simple answer.
Источник: https://stackoverflow.com/questions/780 ... -directory
Мобильная версия