Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

PHP Local Testing Server Not Working!

Community Beginner ,
Nov 28, 2010 Nov 28, 2010

Hi Guys,

I've just set up my PHP local testing server, although its not working properly! If you could help that would be so wonderful!

Here is my current settings:

Local Site Folder: C:\XAMPP\htdocs\valsoo\

Web URL: http://localhost/valsoo/

Server Folder: C:\XAMPP\htdocs\valsoo\

Local/Network

Server Model: PHP MySQL

I'm testing the 'local testing server' with a file called site_check.php which works in the Local Site Folder root (C:\XAMPP\htdocs\valsoo\site_check.php) but fails to work when the file is within folders (C:\XAMPP\htdocs\valsoo\lesson01). Not all files work in the root either. ANY SUGGESTIONS?

Thanks so much!

TOPICS
Server side applications
1.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Nov 30, 2010 Nov 30, 2010

Brentis wrote:

I deleted the C:/htdocs but it didn't change anything.

That doesn't surprise me. If you were having difficulty with files not being found, just deleting a folder won't help. You might have deleted the folder the browser was looking for.

Assuming that XAMPP is installed, make sure that Apache is running, and then type http://localhost in the browser address bar to load the XAMPP admin page. Click the phpinfo() link in the left navigation sidebar, and find the value of DOCUMENT_ROOT in

...
Translate
LEGEND ,
Nov 29, 2010 Nov 29, 2010

Brentis wrote:

I'm testing the 'local testing server' with a file called site_check.php which works in the Local Site Folder root (C:\XAMPP\htdocs\valsoo\site_check.php) but fails to work when the file is within folders (C:\XAMPP\htdocs\valsoo\lesson01). Not all files work in the root either.

If site_check.php works, your local testing server is working.

What do you mean when you say that it fails to work when the file is in a folder, such as lesson01? What actually happens? What sort of files don't work in the root? Without more details, it's impossible to help.

If site_check.php is in C:\XAMPP\htdocs\valsoo\lesson01, you should be able to access the file through http://localhost/valsoo/lesson01/site_check.php.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 29, 2010 Nov 29, 2010

Hi David,

site_check.php is in lesson02, but http://localhost/valsoo/lesson02/site_check.php still fails to work. It comes up with this:

Object Not Found

Error 404

Strangely however, site_check.php works when I put it in the root folder http://localhost/valsoo/site_check.php
I tried putting another file from your cd quotes_01.php into the root folder just like with site_check.php, but it failed to work. Strange!
I just noticed that I had found a folder C:\htdocs\valsoo as well as C:\XAMPP\htdocs\valsoo, could this be a problem?
Thanks David!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 29, 2010 Nov 29, 2010

Brentis wrote:

I tried putting another file from your cd quotes_01.php into the root folder just like with site_check.php, but it failed to work. Strange!
I just noticed that I had found a folder C:\htdocs\valsoo as well as C:\XAMPP\htdocs\valsoo, could this be a problem?

It sounds as though you have set up two testing environments, and C:\htdocs is being regarded as the server root.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 29, 2010 Nov 29, 2010

I'll try deleting C:\htdocs and see if that makes a difference.

Thanks very much for your help David!

Brentis

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 29, 2010 Nov 29, 2010

I deleted the C:/htdocs but it didn't change anything. Maybe testing through my live site using FTP is the only way.. I can't seem to set up my local testing server properly. The testing files site_check.php and test.php work in the root folder, but nowhere else. No other files work in the root folder, or other folders such as lesson01. Strange!

Is testing through your live site using FTP a BIG security risk?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 30, 2010 Nov 30, 2010

Brentis wrote:

I deleted the C:/htdocs but it didn't change anything.

That doesn't surprise me. If you were having difficulty with files not being found, just deleting a folder won't help. You might have deleted the folder the browser was looking for.

Assuming that XAMPP is installed, make sure that Apache is running, and then type http://localhost in the browser address bar to load the XAMPP admin page. Click the phpinfo() link in the left navigation sidebar, and find the value of DOCUMENT_ROOT in the Apache Environment section.

Once you know the correct location for DOCUMENT_ROOT, you should be able to put your files in a subfolder of the DOCUMENT_ROOT folder, and define your testing server correctly in Dreamweaver.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 01, 2010 Dec 01, 2010

David!

I think you've found the problem! The document root is C:/XAMPP/xampp/htdocs

I must have installed it incorrectly or something? There is a file called xampp inside xampp (as shown above) and its exactly the same. Should I delete this file? Or is it meant to be there?

I'll put the files in that document and see if it works anyway

Thanks

Brentis

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 01, 2010 Dec 01, 2010

Brentis wrote:

I think you've found the problem! The document root is C:/XAMPP/xampp/htdocs

I must have installed it incorrectly or something? There is a file called xampp inside xampp (as shown above) and its exactly the same. Should I delete this file?

By default, XAMPP creates a folder called xampp wherever you tell it to install. The normal process is to install XAMPP at the top level of your C drive. What you have done is to create a folder called XAMPP, and installed it there. Hence, XAMPP\xampp.

There is nothing wrong with the structure. Just leave it as it is. Most certainly DO NOT DELETE the other folder.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 01, 2010 Dec 01, 2010

Thanks - I did figure it out and my response to myself is posted, hoping it helps others. This was a "Doh" moment.

Howard Latimer

Senior Graphic Designer

Fitzgerald & Halliday, Inc.

[Phone numbers removed by moderator]


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 01, 2010 Dec 01, 2010

Great, sounds like the problem has been solved! Although what would the web url be?

The same? http://localhost/valsoo/?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 01, 2010 Dec 01, 2010

Brentis wrote:

Great, sounds like the problem has been solved! Although what would the web url be?

The same? http://localhost/valsoo/?

Yes.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 01, 2010 Dec 01, 2010
LATEST

I just used localhost/valsoo and yes it works! Finally!

Thanks very much for your help David! Its much appreciated!!

Brentis

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines