PHP not running in Xampp

Alles, was PHP betrifft, kann hier besprochen werden.

PHP not running in Xampp

Postby screenprintr » 14. October 2019 17:12

Have a Windows 10 PC, with XAMPP. I place my files in c:/localhost/htdocs/PROJECT-FOLDER. I.E. whatever project I'm working on.

MySql works fine. created a Form login/register site, and it runs, however PHP doesn't seem to be working.

Created a Test program or two. Let's call them test.php, test2.php. Included the HTML, Head, Body tags, H1, and include <?php basic php code ?>. Yes, this is in: /localhost/htdocs/test.php and /localhost/htdocs/test1.php. Neither work from my FireFox browser. Did not try another browser.

Uploaded the files to my online hosting. Works fine there.

Any ideas of what I can do to fix this PHP issue? How do I troubleshoot this? MySQL and PHPMyAdmin works fine. Able to create database, tables, and columns.

Thank you in advance,

Paul
screenprintr
 
Posts: 4
Joined: 14. October 2019 16:52
XAMPP version: 7
Operating System: Windows 10

Re: PHP not running in Xampp

Postby Altrea » 14. October 2019 18:39

screenprintr wrote:Have a Windows 10 PC, with XAMPP. I place my files in c:/localhost/htdocs/PROJECT-FOLDER. I.E. whatever project I'm working on.

But you did not type in c:/localhost/htdocs/Project-Folder into your browser, did you?
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 9849
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: PHP not running in Xampp

Postby screenprintr » 14. October 2019 18:47

No, I only typed in /localhost/test.php and /localhost/test1.php

Not at home right now so I can't say the exact php version.
screenprintr
 
Posts: 4
Joined: 14. October 2019 16:52
XAMPP version: 7
Operating System: Windows 10

Re: PHP not running in Xampp

Postby Nobbie » 14. October 2019 21:57

screenprintr wrote:Have a Windows 10 PC, with XAMPP. I place my files in c:/localhost/htdocs/PROJECT-FOLDER. I.E. whatever project I'm working on.


... what is absolute total nonsense! Who told you to do so?

Put your files into c:/xampp/htdocs instead, for example c:/xampp/htdocs/test.php and finally execute it via http://localhost/test.php

Last not least urgently read the Xampp FAQ and the Apache Documentation about DocumentRoot. What you are doing here actually is a pain!
Nobbie
 
Posts: 11202
Joined: 09. March 2008 13:04

Re: PHP not running in Xampp

Postby screenprintr » 14. October 2019 23:10

Not sure what happen to my response. Nobbie is write. I saved my files in: c:/xampp/htdocs.

Also, since I'm not at home, I can't remember if I used Single or Double quotes. Double will take out the $ sign once you render the code.
screenprintr
 
Posts: 4
Joined: 14. October 2019 16:52
XAMPP version: 7
Operating System: Windows 10

Re: PHP not running in Xampp

Postby screenprintr » 15. October 2019 03:02

Sorry, Nobbie is Right.

So, once I got home I tried replacing single quotes with double quotes. It fixed some of the errors. The rest is due to Not Opening my PHP with the URL. If you open the PHP files with a Folder Dialog box you get the errors.

It was actually two issues that fixed the problems.

Thank you for your help. I found the Quote fix from Larry Ullman's book, Php and MySQL for Dynamic Web Sites, and the Opening a PHP file from the URL in this forum.
screenprintr
 
Posts: 4
Joined: 14. October 2019 16:52
XAMPP version: 7
Operating System: Windows 10


Return to PHP

Who is online

Users browsing this forum: No registered users and 1 guest