VSCode php server [404] / - No such file or directory problem - php

I have installed php server on my vscode with a proper php server from php.net used at $PATH
But when I try to press
PHP Server: Serve project
I get the following error:
[Tue Oct 25 21:30:53 2022] PHP 8.1.11 Development Server (http://localhost:3000) started
[Tue Oct 25 21:34:55 2022] [::1]:62162 Accepted
[Tue Oct 25 21:34:55 2022] [::1]:62163 Accepted
[Tue Oct 25 19:34:55 2022] [404] / - No such file or directory
[Tue Oct 25 21:34:55 2022] [::1]:62163 [404]: GET / - No such file or directory
[Tue Oct 25 21:34:55 2022] [::1]:62163 Closing
[Tue Oct 25 21:36:07 2022] [::1]:62162 Closed without sending a request; it was probably just an unused speculative preconnection
[Tue Oct 25 21:36:07 2022] [::1]:62162 Closing

Related

https://learnforge.autodesk.io/#/environment/setup/php - step by step tutorial of forge.autodesk - unable to execute

My objective**: Rendering 3D model (dwg file) in chrome web browser using autodesk WebGL-
based viewer using javascript library
What I've done: explored a step by step tutorial of forge.autodesk.com as below
https://learnforge.autodesk.io/#/environment/setup/php
https://learnforge.autodesk.io/#/oauth/2legged/php
3) https://learnforge.autodesk.io/#/datamanagement/oss/php
https://learnforge.autodesk.io/#/modelderivative/translate/php
https://learnforge.autodesk.io/#/viewer/2legged/php
https://learnforge.autodesk.io/#/viewer/2legged/ui
https://learnforge.autodesk.io/#/environment/rundebug/php
when I said "serve project" in php server command pallette, it has thrown below error
[Fri Aug 12 17:32:58 2022] PHP 7.4.30 Development Server (http://localhost:3000) started
[Fri Aug 12 17:32:58 2022] [::1]:54723 Accepted
[Fri Aug 12 12:02:58 2022] [404] / - No such file or directory
[Fri Aug 12 17:32:59 2022] [::1]:54723 [404]: GET /
[Fri Aug 12 17:32:59 2022] [::1]:54723 Closing
Appreciate guidance

Laravel server closes after starting it up

So I created a Laravel project and tried to boot it up,
however every time I do so it closes down again
Laravel development server started on http://localhost:8000
[Sat Jan 15 13:27:20 2022] PHP 7.4.27 Development Server (http://localhost:8000) started
[Sat Jan 15 13:27:42 2022] [::1]:55208 Accepted
[Sat Jan 15 13:27:42 2022] [::1]:55209 Accepted
[Sat Jan 15 13:27:42 2022] [::1]:55208 Closing
[Sat Jan 15 13:27:42 2022] [::1]:55209 [200]: GET /favicon.ico
[Sat Jan 15 13:27:42 2022] [::1]:55209 Closing
I tried changing the port to 9000 but that also didn't work
Laravel development server started on http://localhost:9000
[Sat Jan 15 13:30:02 2022] PHP 7.4.27 Development Server (http://localhost:9000) started
[Sat Jan 15 13:30:16 2022] [::1]:54118 Accepted
[Sat Jan 15 13:30:16 2022] [::1]:54119 Accepted
[Sat Jan 15 13:30:16 2022] [::1]:54118 Closing
[Sat Jan 15 13:30:17 2022] [::1]:54119 [200]: GET /favicon.ico
[Sat Jan 15 13:30:17 2022] [::1]:54119 Closing
[Sat Jan 15 13:30:19 2022] [::1]:54125 Accepted
[Sat Jan 15 13:30:19 2022] [::1]:54126 Accepted
[Sat Jan 15 13:30:19 2022] [::1]:54125 Closing
[Sat Jan 15 13:30:20 2022] [::1]:54126 [200]: GET /favicon.ico
[Sat Jan 15 13:30:20 2022] [::1]:54126 Closing
does anyone know what's happening here?
That is not a problem, it's working fine. By the closing in logs, it means it's closing the specific connection.
Here's a log from my laravel install

PHP 7.4.1 Development Server - Double requests

When I run the PHP development server, I see all request appear twice. It could be an explanation why I am having problems validating CSRF codes (they are generated twice, so the one in the form and the one finally in the session are not the same):
[Fri Mar 20 20:29:53 2020] PHP 7.4.1 Development Server (http://0.0.0.0:8080) started
[Fri Mar 20 20:30:07 2020] 127.0.0.1:51335 Accepted
[Fri Mar 20 20:30:07 2020] 127.0.0.1:51336 Accepted
[Fri Mar 20 20:30:07 2020] 127.0.0.1:51335 [200]: GET /
[Fri Mar 20 20:30:07 2020] 127.0.0.1:51335 Closing
[Fri Mar 20 20:30:07 2020] 127.0.0.1:51336 [200]: GET /
[Fri Mar 20 20:30:07 2020] 127.0.0.1:51336 Closing
Anyone an idea why this is happening?
This is how I started the server:
php -S 0.0.0.0:8080 -t public/
I checked FPM config and changed the value of servers to start to 1 (I thought it might be fpm related), but to no avail.
Mac OS X Catalina (10.15.3), PHP 7.4.1
Extra info:
created a new directory public with 1 index.php file in it containing:
hello world
<?php
file_put_contents(__DIR__ . '/../requests.log', date('Y-m-d H:i:s') . PHP_EOL, FILE_APPEND);
Running the server, and calling the page ONCE:
user#server test % php -S 0.0.0.0:8080 -t public/
[Fri Mar 20 21:04:14 2020] PHP 7.4.1 Development Server (http://0.0.0.0:8080) started
[Fri Mar 20 21:04:16 2020] 127.0.0.1:56020 Accepted
[Fri Mar 20 21:04:16 2020] 127.0.0.1:56021 Accepted
[Fri Mar 20 21:04:17 2020] 127.0.0.1:56020 [200]: GET /
[Fri Mar 20 21:04:17 2020] 127.0.0.1:56020 Closing
[Fri Mar 20 21:04:17 2020] 127.0.0.1:56021 [200]: GET /
[Fri Mar 20 21:04:17 2020] 127.0.0.1:56021 Closing
Yields this in the log:
2020-03-20 20:06:58
2020-03-20 20:06:58
processes on the laptop:
user#laptop test % ps -ef | grep php
0 163 1 0 8:25PM ?? 0:00.13 /usr/local/opt/php/sbin/php-fpm --nodaemonize
501 331 163 0 8:25PM ?? 0:00.00 /usr/local/opt/php/sbin/php-fpm --nodaemonize
501 1326 163 0 8:37PM ?? 0:00.00 /usr/local/opt/php/sbin/php-fpm --nodaemonize
Curl 0.0.0.0:8080 as #maartendev proposed yields:
[Fri Mar 20 21:09:21 2020] PHP 7.4.1 Development Server (http://0.0.0.0:8080) started
[Fri Mar 20 21:09:24 2020] 127.0.0.1:56335 Accepted
[Fri Mar 20 21:09:24 2020] 127.0.0.1:56335 [200]: GET /
[Fri Mar 20 21:09:24 2020] 127.0.0.1:56335 Closing
Thanks
Jeroen

PHP XAMPP log interpretation - server shutting down / connecton lost from browser

Okay, first of all I understand and ... permit ... you all to laugh: I have a local server running php 4,4 / apache / mysql - installed with xampp distribution. Just simply haven't got the time to upgrade all the code that has been serving me for years and is still serving me well :-)
To the issue - I can't make a try/catch ... beeeecause of the old php version. I have a script that parses a dir and to a lot of things to all the files ... and after several 100 thousand files over the years without problems ... I now find that the server shuts down / browser looses connection probably because of a single file ... but for my life I can't figure out which. So thought maybe I could figure it out through the error log. But ... I didn't learn much - and thought I might ask some wise guys here if there is anything I can learn from the following from my error log - regarding maybe what function/file or whatever it is that causes the breaking...:
[Tue Feb 14 20:47:26 2017] [crit] (22)Invalid argument: unable to replace stderr with error_log
[Tue Feb 14 20:47:26 2017] [crit] (2)No such file or directory: unable to replace stderr with /dev/null
[Tue Feb 14 20:47:26 2017] [notice] Apache/2.0.54 (Win32) mod_ssl/2.0.54 OpenSSL/0.9.8 PHP/4.4.0 mod_autoindex_color configured -- resuming normal operations
[Tue Feb 14 20:47:26 2017] [notice] Server built: Jul 28 2005 18:10:37
[Tue Feb 14 20:47:26 2017] [notice] Parent: Created child process 5384
[Tue Feb 14 20:47:27 2017] [notice] Child 5384: Child process is running
[Tue Feb 14 20:47:27 2017] [notice] Child 5384: Acquired the start mutex.
[Tue Feb 14 20:47:27 2017] [notice] Child 5384: Starting 250 worker threads.
[Tue Feb 14 20:47:36 2017] [notice] Parent: child process exited with status 3221225725 -- Restarting.
[Tue Feb 14 20:47:36 2017] [crit] (22)Invalid argument: unable to replace stderr with error_log
[Tue Feb 14 20:47:36 2017] [crit] (2)No such file or directory: unable to replace stderr with /dev/null
[Tue Feb 14 20:47:36 2017] [notice] Apache/2.0.54 (Win32) mod_ssl/2.0.54 OpenSSL/0.9.8 PHP/4.4.0 mod_autoindex_color configured -- resuming normal operations
[Tue Feb 14 20:47:36 2017] [notice] Server built: Jul 28 2005 18:10:37
[Tue Feb 14 20:47:36 2017] [notice] Parent: Created child process 3136
[Tue Feb 14 20:47:36 2017] [notice] Child 3136: Child process is running
[Tue Feb 14 20:47:36 2017] [notice] Child 3136: Acquired the start mutex.
[Tue Feb 14 20:47:36 2017] [notice] Child 3136: Starting 250 worker threads.
Got it ... filesize() was failing (silent aparently) for some file(s). Ran it w/o this function and it worked. Case closed...
Edit: strange though ... filesize() suddenly fails on all files. And they are local. Subdir to the htdocs folder ... and the top level folder to this structure is set to all my users to have full control of this folder and all subfolders... weird...

PHP GoDaddy VPS Not Error Reporting

BEFORE YOU MARK THIS A DUPLICATE READ PLEASE
I've read dozens of threads both on this site and other with possible solutions to my problem however none have helped.
I switched to a GoDaddy VPS and I cannot get php to log errors what so ever. I went to their chat support and they basically told me I was on my own. My current php.ini settings below.
error_reporting = E_ALL
display_startup_errors = On
log_errors = On
track_errors = On
error_log = error_log
display_errors = On
Current php version I have installed php 7.0 and the extensions that are installed below. (Not sure if this info is beneficial)
php70-libc-client I
php70-pear
php70-php-bcmath
php70-php-calendar
php70-php-cli
php70-php-ftp
php70-php-fpm
php70-php-devel
php70-php-curl
php70-php-common
php70-php-gd
php70-php-imap
php70-php-mcrypt
php70-php-mysqlnd
php70-php-pdo
php70-php-posix
php70-runtime
php70-php-xml
php70-php-sockets
More Information (might be useful)
- I restarted my server multiple times.
- Using mysqli as data storage.
Error Logs That Exist
- /usr/local/cpanel/logs/error_log /usr/local/apache.ea3/logs/error_log
- /opt/cpanel/ea-php70/root/usr/share/pear/error_log
- /var/installatron/logs/error_log /var/log/httpd/error_log
- /var/log/apache2/error_log /home/server1/public_html/css/error_log
- /home/server1/public_html/php/error_log
- /home/server1/public_html/contact/error_log /home/server1/.trash/error_log
- /home/server2/public_html/error_log /home/server2/public_html/php/error_log
- /home/server2/public_html/faq/error_log
which one would be the main one?
With the help of Max (below) I found some error logs.
[Tue Nov 29 14:58:23.876535 2016] [:notice] [pid 1072] ModSecurity: APR compile$
[Tue Nov 29 14:58:23.876543 2016] [:notice] [pid 1072] ModSecurity: PCRE compil$
[Tue Nov 29 14:58:23.876548 2016] [:notice] [pid 1072] ModSecurity: LUA compile$
[Tue Nov 29 14:58:23.876552 2016] [:notice] [pid 1072] ModSecurity: LIBXML comp$
[Tue Nov 29 14:58:23.876555 2016] [:notice] [pid 1072] ModSecurity: Status engi$
[Tue Nov 29 14:58:23.901172 2016] [ssl:warn] [pid 1073] AH01909: s104-238-126-2$
[Tue Nov 29 14:58:23.902445 2016] [:notice] [pid 1073] mod_ruid2/0.9.8 enabled
[Tue Nov 29 14:58:23.905483 2016] [mpm_prefork:notice] [pid 1073] AH00163: Apac$
[Tue Nov 29 14:58:23.905502 2016] [core:notice] [pid 1073] AH00094: Command lin$
(XID sda356) Database Connect Error: Access denied for user 'leechprotect'#'localhost' (using password: YES)

Categories