skip to Main Content

I’m starting learning php and the first thing is to run the Development Server to start practicing, i use commands of html and then the code php , and all of this indo a file php on vs code

and i receive this message

[Fri Dec 29 11:20:03 2023] PHP 8.2.12 Development Server (http://localhost:3000) started

and after waiting for a long amount of time i get this :

[Fri Dec 29 11:33:12 2023] [::1]:63950 Accepted
[Fri Dec 29 11:33:12 2023] [::1]:63951 Accepted

[Fri Dec 29 11:33:12 2023] [404] /projet.php – No such file or directory
[Fri Dec 29 11:33:12 2023] [::1]:63950 [404]: GET /projet.php – No such file or directory

[Fri Dec 29 11:33:12 2023] [::1]:63950 Closing

[Fri Dec 29 11:33:12 2023] [404] /favicon.ico – No such file or directory [Fri Dec 29 11:33:12 2023] [::1]:63951 [404]: GET /favicon.ico – No such file or directory

[Fri Dec 29 11:33:12 2023] [::1]:63951 Closing

[Fri Dec 29 11:37:20 2023] [::1]:63959 Accepted

[Fri Dec 29 11:37:20 2023] [404] /projet.php – No such file or directory
[Fri Dec 29 11:37:20 2023] [::1]:63959 [404]: GET /projet.php – No such file or directory
[Fri Dec 29 11:37:20 2023] [::1]:63960 Accepted

[Fri Dec 29 11:37:20 2023] [::1]:63959 Closing

[Fri Dec 29 11:39:03 2023] [::1]:63960 Closed without sending a request; it was probably just an unused speculative preconnection
[Fri Dec 29 11:39:03 2023] [::1]:63960 Closing

and even i do http://localhost:3000/index.php i didn’t get a result , i get always:

"The requested resource /projet.php was not found on this server."

2

Answers


  1. I suppose you created a file projet.php, but it’s not where the server expects it to be. You are trying to find it in the root directory of your webserver (as per the webserver’s configuration) but it’s not at that location. Check your webserver’s configuration and move projet.php to the directory that represents the server’s root directory.

    Login or Signup to reply.
  2. may sound obvious but, does the file "projet.php" exists?
    Have you double checked for some typos in code / filenames? "projet.php" may be "project.php"

    If you could post the code, it’ll be easier for the community to help you.

    My guess is that the code located in "index.php" is making some sort of GET request for the content inside "projet.php", since that file cannot be found the code does not work properly.

    The fact that is taking longer to actually write the log may be due to the call to "projet.php" with cUrl.

    If you’re using cUrl with PHP you can use the "CURLOPT_CONNECTTIMEOUT" option to specify an amount of seconds that the code can wait to connect successfully or terminate the connection otherwise.

    Be aware that having "CURLOPT_CONNECTTIMEOUT" set to 0, will cause the connection wait indefinitely and it’s not advised.

    Hope that helped,
    cheers

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search