php scripts not working in xampp + browser shows no error messages

php scripts not working in xampp + browser shows no error messages

I cannot get any php script to run using xampp. I’m trying to input form data via Firefox and then connect into my database (created using phpmyadmin) to insert the data into a table.

Because in ancient times I used to work with dbIII+, I used the Shell/CLI (accessed via XAMPP Control Panel) to successfully CREATE a database with 1 simple table and INSERTed 3 records. By the way, I did this after logging in to a USER I had created earlier.

However when I took a step up to using an html + php file to do the same job, no new records get INSERTed. The very simple html file runs correctly but the php produces a blank browser screen. The php should be echoing messages like connected, not connected, successfully inserted etc as these exist in the php coding.

In case you think I have made a Schoolboy error the approach I used was to copy and paste code from good sources e.g. W3, Tutorial Republic, SQL Documentation etc which I then customised with my user name, password, column names, database and table names etc. I also experimented with Youtube suggestions e.g. mmtuts. And https://www.codeofaninja.com/2013/06/how-to-run-a-php-script.html And I tried my own creation too.

I do understand there are 3 alternative API’s/php Connectors viz. mysql (deprecated), mysqli (procedural) and PDO (object oriented). I’m sticking to the mysqli style.

In my simplistic logic I suspect there is a problem with the XAMPP installation BUT I did install it with UAC switched off in the Registry and XAMPP is letting me create Websites without any problems at all.

As I’m in the early learner phase any help pitched at that level would be very much appreciated.

What does the error logs show you? It’s in your XAMPP installation under the php folder.

Thanks for your quick reponse!
I’ve got jobs to do for my Mum today so I hope to reply tommorrow.

The log files on my XAMPP installation are under xampp > apache > logs

I cannot find anything called logs

That’s not the directory I suggested looking in.

Yes I see! Which error log would you like?

There’s only 1 error log - it’s called error.log

2 Likes

[Sat Mar 16 02:03:38.114319 2019] [ssl:warn] [pid 7136:tid 420] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sat Mar 16 02:03:38.192454 2019] [ssl:warn] [pid 7136:tid 420] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sat Mar 16 02:03:38.223714 2019] [mpm_winnt:notice] [pid 7136:tid 420] AH00455: Apache/2.4.38 (Win32) OpenSSL/1.1.1a PHP/7.3.2 configured – resuming normal operations
[Sat Mar 16 02:03:38.223714 2019] [mpm_winnt:notice] [pid 7136:tid 420] AH00456: Apache Lounge VC15 Server built: Jan 18 2019 12:31:19
[Sat Mar 16 02:03:38.223714 2019] [core:notice] [pid 7136:tid 420] AH00094: Command line: ‘c:\xampp\apache\bin\httpd.exe -d C:/xampp/apache’
[Sat Mar 16 02:03:38.223714 2019] [mpm_winnt:notice] [pid 7136:tid 420] AH00418: Parent: Created child process 5464
[Sat Mar 16 02:03:38.848742 2019] [ssl:warn] [pid 5464:tid 448] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sat Mar 16 02:03:38.926828 2019] [ssl:warn] [pid 5464:tid 448] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sat Mar 16 02:03:38.942453 2019] [mpm_winnt:notice] [pid 5464:tid 448] AH00354: Child: Starting 150 worker threads.
[Sat Mar 16 02:04:18.286607 2019] [ssl:warn] [pid 4972:tid 424] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sat Mar 16 02:04:18.349145 2019] [core:warn] [pid 4972:tid 424] AH00098: pid file C:/xampp/apache/logs/httpd.pid overwritten – Unclean shutdown of previous Apache run?
[Sat Mar 16 02:04:18.349145 2019] [ssl:warn] [pid 4972:tid 424] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sat Mar 16 02:04:18.380370 2019] [mpm_winnt:notice] [pid 4972:tid 424] AH00455: Apache/2.4.38 (Win32) OpenSSL/1.1.1a PHP/7.3.2 configured – resuming normal operations
[Sat Mar 16 02:04:18.380370 2019] [mpm_winnt:notice] [pid 4972:tid 424] AH00456: Apache Lounge VC15 Server built: Jan 18 2019 12:31:19
[Sat Mar 16 02:04:18.380370 2019] [core:notice] [pid 4972:tid 424] AH00094: Command line: ‘c:\xampp\apache\bin\httpd.exe -d C:/xampp/apache’
[Sat Mar 16 02:04:18.380370 2019] [mpm_winnt:notice] [pid 4972:tid 424] AH00418: Parent: Created child process 6816
[Sat Mar 16 02:04:19.177295 2019] [ssl:warn] [pid 6816:tid 424] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sat Mar 16 02:04:19.271009 2019] [ssl:warn] [pid 6816:tid 424] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sat Mar 16 02:04:19.286634 2019] [mpm_winnt:notice] [pid 6816:tid 424] AH00354: Child: Starting 150 worker threads.
[Sat Mar 16 13:12:10.620700 2019] [ssl:warn] [pid 10392:tid 472] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sat Mar 16 13:12:10.714504 2019] [core:warn] [pid 10392:tid 472] AH00098: pid file C:/xampp/apache/logs/httpd.pid overwritten – Unclean shutdown of previous Apache run?
[Sat Mar 16 13:12:10.714504 2019] [ssl:warn] [pid 10392:tid 472] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sat Mar 16 13:12:10.745701 2019] [mpm_winnt:notice] [pid 10392:tid 472] AH00455: Apache/2.4.38 (Win32) OpenSSL/1.1.1a PHP/7.3.2 configured – resuming normal operations
[Sat Mar 16 13:12:10.745701 2019] [mpm_winnt:notice] [pid 10392:tid 472] AH00456: Apache Lounge VC15 Server built: Jan 18 2019 12:31:19
[Sat Mar 16 13:12:10.745701 2019] [core:notice] [pid 10392:tid 472] AH00094: Command line: ‘C:\xampp\apache\bin\httpd.exe -d C:/xampp/apache’
[Sat Mar 16 13:12:10.745701 2019] [mpm_winnt:notice] [pid 10392:tid 472] AH00418: Parent: Created child process 10356
[Sat Mar 16 13:12:11.355097 2019] [ssl:warn] [pid 10356:tid 336] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sat Mar 16 13:12:11.417584 2019] [ssl:warn] [pid 10356:tid 336] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sat Mar 16 13:12:11.448863 2019] [mpm_winnt:notice] [pid 10356:tid 336] AH00354: Child: Starting 150 worker threads.
[Sat Mar 16 13:30:51.057875 2019] [mpm_winnt:notice] [pid 10392:tid 472] AH00422: Parent: Received shutdown signal – Shutting down the server.
[Sat Mar 16 13:30:53.089204 2019] [mpm_winnt:notice] [pid 10356:tid 336] AH00364: Child: All worker threads have exited.
[Sat Mar 16 13:30:58.337646 2019] [mpm_winnt:notice] [pid 10392:tid 472] AH00430: Parent: Child process 10356 exited successfully.
[Sat Mar 16 13:52:42.196746 2019] [ssl:warn] [pid 2124:tid 476] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sat Mar 16 13:52:42.618661 2019] [ssl:warn] [pid 2124:tid 476] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sat Mar 16 13:52:48.679164 2019] [mpm_winnt:notice] [pid 2124:tid 476] AH00455: Apache/2.4.38 (Win32) OpenSSL/1.1.1a PHP/7.3.2 configured – resuming normal operations
[Sat Mar 16 13:52:48.679164 2019] [mpm_winnt:notice] [pid 2124:tid 476] AH00456: Apache Lounge VC15 Server built: Jan 18 2019 12:31:19
[Sat Mar 16 13:52:48.679164 2019] [core:notice] [pid 2124:tid 476] AH00094: Command line: ‘C:\xampp\apache\bin\httpd.exe -d C:/xampp/apache’
[Sat Mar 16 13:52:48.772863 2019] [mpm_winnt:notice] [pid 2124:tid 476] AH00418: Parent: Created child process 3900
[Sat Mar 16 13:52:54.132305 2019] [ssl:warn] [pid 3900:tid 384] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sat Mar 16 13:52:54.272914 2019] [ssl:warn] [pid 3900:tid 384] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sat Mar 16 13:52:54.304164 2019] [mpm_winnt:notice] [pid 3900:tid 384] AH00354: Child: Starting 150 worker threads.
[Sat Mar 16 14:14:32.575913 2019] [mpm_winnt:notice] [pid 2124:tid 476] AH00422: Parent: Received shutdown signal – Shutting down the server.
[Sat Mar 16 14:14:34.607183 2019] [mpm_winnt:notice] [pid 3900:tid 384] AH00364: Child: All worker threads have exited.
[Sat Mar 16 14:14:34.669652 2019] [mpm_winnt:notice] [pid 2124:tid 476] AH00430: Parent: Child process 3900 exited successfully.
[Sat Mar 16 14:37:22.793613 2019] [ssl:warn] [pid 2204:tid 468] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sat Mar 16 14:37:22.934242 2019] [ssl:warn] [pid 2204:tid 468] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sat Mar 16 14:37:25.106140 2019] [mpm_winnt:notice] [pid 2204:tid 468] AH00455: Apache/2.4.38 (Win32) OpenSSL/1.1.1a PHP/7.3.2 configured – resuming normal operations
[Sat Mar 16 14:37:25.106140 2019] [mpm_winnt:notice] [pid 2204:tid 468] AH00456: Apache Lounge VC15 Server built: Jan 18 2019 12:31:19
[Sat Mar 16 14:37:25.106140 2019] [core:notice] [pid 2204:tid 468] AH00094: Command line: ‘C:\xampp\apache\bin\httpd.exe -d C:/xampp/apache’
[Sat Mar 16 14:37:25.106140 2019] [mpm_winnt:notice] [pid 2204:tid 468] AH00418: Parent: Created child process 2416
[Sat Mar 16 14:37:25.684255 2019] [ssl:warn] [pid 2416:tid 416] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sat Mar 16 14:37:25.762383 2019] [ssl:warn] [pid 2416:tid 416] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sat Mar 16 14:37:25.793603 2019] [mpm_winnt:notice] [pid 2416:tid 416] AH00354: Child: Starting 150 worker threads.
[Sat Mar 16 17:57:54.108910 2019] [mpm_winnt:notice] [pid 2204:tid 468] AH00422: Parent: Received shutdown signal – Shutting down the server.
[Sat Mar 16 17:57:56.140226 2019] [mpm_winnt:notice] [pid 2416:tid 416] AH00364: Child: All worker threads have exited.
[Sat Mar 16 17:57:56.187046 2019] [mpm_winnt:notice] [pid 2204:tid 468] AH00430: Parent: Child process 2416 exited successfully.
[Sat Mar 16 21:21:54.764728 2019] [ssl:warn] [pid 1588:tid 460] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sat Mar 16 21:21:54.996138 2019] [ssl:warn] [pid 1588:tid 460] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sat Mar 16 21:21:55.027161 2019] [mpm_winnt:notice] [pid 1588:tid 460] AH00455: Apache/2.4.38 (Win32) OpenSSL/1.1.1a PHP/7.3.2 configured – resuming normal operations
[Sat Mar 16 21:21:55.060966 2019] [mpm_winnt:notice] [pid 1588:tid 460] AH00456: Apache Lounge VC15 Server built: Jan 18 2019 12:31:19
[Sat Mar 16 21:21:55.060966 2019] [core:notice] [pid 1588:tid 460] AH00094: Command line: ‘C:\xampp\apache\bin\httpd.exe -d C:/xampp/apache’
[Sat Mar 16 21:22:00.720772 2019] [mpm_winnt:notice] [pid 1588:tid 460] AH00418: Parent: Created child process 8492
[Sat Mar 16 21:22:01.333266 2019] [ssl:warn] [pid 8492:tid 408] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sat Mar 16 21:22:01.407175 2019] [ssl:warn] [pid 8492:tid 408] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sat Mar 16 21:22:01.442199 2019] [mpm_winnt:notice] [pid 8492:tid 408] AH00354: Child: Starting 150 worker threads.
[Sat Mar 16 22:05:45.785932 2019] [mpm_winnt:notice] [pid 1588:tid 460] AH00422: Parent: Received shutdown signal – Shutting down the server.
[Sat Mar 16 22:05:47.817259 2019] [mpm_winnt:notice] [pid 8492:tid 408] AH00364: Child: All worker threads have exited.
[Sat Mar 16 22:05:47.848471 2019] [mpm_winnt:notice] [pid 1588:tid 460] AH00430: Parent: Child process 8492 exited successfully.
[Sun Mar 17 01:13:30.078753 2019] [ssl:warn] [pid 2272:tid 472] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sun Mar 17 01:13:30.422505 2019] [ssl:warn] [pid 2272:tid 472] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sun Mar 17 01:13:43.863916 2019] [mpm_winnt:notice] [pid 2272:tid 472] AH00455: Apache/2.4.38 (Win32) OpenSSL/1.1.1a PHP/7.3.2 configured – resuming normal operations
[Sun Mar 17 01:13:43.863916 2019] [mpm_winnt:notice] [pid 2272:tid 472] AH00456: Apache Lounge VC15 Server built: Jan 18 2019 12:31:19
[Sun Mar 17 01:13:43.863916 2019] [core:notice] [pid 2272:tid 472] AH00094: Command line: ‘C:\xampp\apache\bin\httpd.exe -d C:/xampp/apache’
[Sun Mar 17 01:13:43.879540 2019] [mpm_winnt:notice] [pid 2272:tid 472] AH00418: Parent: Created child process 5720
[Sun Mar 17 01:13:44.707672 2019] [ssl:warn] [pid 5720:tid 380] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sun Mar 17 01:13:44.895192 2019] [ssl:warn] [pid 5720:tid 380] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sun Mar 17 01:13:44.926424 2019] [mpm_winnt:notice] [pid 5720:tid 380] AH00354: Child: Starting 150 worker threads.

Let’s… start with the basics. Create a file that contains the following.

<?php phpinfo(); ?>
And run it.

I’ve done this in the php interactive shell with php -i

I’ve also just done this by creating a .php file in the htdocs folder but when I run it in the browser …
C:/xampp/htdocs/m_hutley.php
all I get is a blank

If you’ve put that into your browser bar, you’re not going to the server.

Your browser bar should read

http://localhost/m_hutley.php

2 Likes

Dear m_hutley,
Yes I thought so, what is the next step ?
Is there a simple, obvious solution or does this problem require deeper investigation ?
Do you want to see my code /error logs ?

Did putting that into the browser bar display the PHP information panel?

If yes, then PHP is working, and you should be looking to debug your code.
If no, show me the bottom few lines from access.log (in the same folder as error.log)

Thanks for the correction
http://127.0.0.1:81/m_hutley.php
and
http://localhost:81/m_hutley.php
do display the php info panel

ok, so your xampp is running on port 81 (which… might actually indicate you’ve got 2 instances running, if you didnt specifically configure it that way).

If you go to your pages using localhost:81 , do they work? Or do we need to help debug your code?

::1 - - [17/Mar/2019:11:41:03 +0000] “GET /phpmyadmin/js/sql.js?v=4.8.5 HTTP/1.1” 200 38428 “-” “Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0”
::1 - - [17/Mar/2019:11:41:03 +0000] “GET /phpmyadmin/index.php?ajax_request=1&recent_table=1&no_debug=true&_nocache=1552822863935574640&token=(9%3F*%3F%7Dcj_P%3ACNf5Y HTTP/1.1” 200 1495 “-” “Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0”
::1 - - [17/Mar/2019:11:41:04 +0000] “GET /phpmyadmin/themes/pmahomme/img/col_drop.png HTTP/1.1” 200 111 “-” “Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0”
::1 - - [17/Mar/2019:11:41:04 +0000] “GET /phpmyadmin/themes/pmahomme/img/col_pointer.png HTTP/1.1” 200 102 “-” “Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0”
::1 - - [17/Mar/2019:13:57:20 +0000] “GET /m_hutley.php HTTP/1.1” 200 93266 “-” “Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0”
::1 - - [17/Mar/2019:13:57:20 +0000] “GET /favicon.ico HTTP/1.1” 200 30894 “-” “Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0”
127.0.0.1 - - [17/Mar/2019:13:57:48 +0000] “GET /m_hutley.php HTTP/1.1” 200 93290 “-” “Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0”
127.0.0.1 - - [17/Mar/2019:13:57:48 +0000] “GET /favicon.ico HTTP/1.1” 200 30894 “-” “Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0”
127.0.0.1 - - [17/Mar/2019:14:01:11 +0000] “GET /m_hutley.php HTTP/1.1” 200 93735 “-” “Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0”
127.0.0.1 - - [17/Mar/2019:14:01:11 +0000] “GET /favicon.ico HTTP/1.1” 200 30894 “-” “Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0”

I had to set it up with port 81 because there was a conflict that stopped Apache from starting up