My localhost works but it won't show the index of php files

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

My localhost works but it won't show the index of php files

Postby swn » 07. April 2019 17:53

Hi,

My localhost says it works but it won't show the index of files I saved in hotdocs in Xampp aka lampp. It won’t run any of my php files I made on my local host. Even when I replace localhost with the IP address at the start of the url, my php sites won’t run on local host. I know there isn’t an error in the php codes because I followed a tutorial while I made the php. The files I want to test are in one folder saved in htdocs. A folder I created called USER VERIFICATION is in my htdocs. When one clicks on my folder I created there is a php file called Signup.php. I want to run it on my local host, which says “It works!”. But it won’t work when I try to run my php file. I put localhost/userverification/signup.php

Help me fix this so that I can run my php files on my local host. Side note: I clicked on the question mark tab in the bottom left corner of the XAMPP General tab window to get to this page. Please reply in English because I don't speak German. I appreciate your help.

Sincerely,

swn
swn
 
Posts: 4
Joined: 07. April 2019 17:44
XAMPP version: 7.3.3-1
Operating System: MAC

Re: My localhost works but it won't show the index of php fi

Postby Nobbie » 08. April 2019 03:01

1) Show us the code of PHP which does not work.
2) What does it mean "does not work"? What exactly happens? Any error message? Or what?
3) What exactly do you enter in your browser in order to run your own PHP script?
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: My localhost works but it won't show the index of php fi

Postby swn » 08. April 2019 20:05

I typed in the url box:

192.168.64.2/userverification/signup.php

and then when it didn't work,

192.168.64.2/user-verification/signup.php

Outcomes of both when I clicked enter:

Object not found!
The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.
If you think this is a server error, please contact the webmaster.
Error 404
192.168.64.2
Apache/2.4.38 (Unix) OpenSSL/1.0.2r PHP/7.3.3 mod_perl/2.0.8-dev Perl/v5.16.3

I typed in the url box:

localhost/user-verification/signup.php

and then when it didn't work,

localhost/userverification/signup.php

Outcomes of both when I clicked enter:

Object not found!
The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.
If you think this is a server error, please contact the webmaster.
Error 404
localhost
Apache/2.4.38 (Unix) OpenSSL/1.0.2r PHP/7.3.3 mod_perl/2.0.8-dev Perl/v5.16.3

It won't even show the list of files in the folder I created and saved in the right place. I know the codes in the php aren't the problem because I followed a step by step tutorial by experts and they work if saved as html and run on other free hosting sites (but its not saved as html though, its saved as php because I want to learn php for register/login). The signup.php is designed for a user to register by entering their username, email, password, and click submit. My localhost says "It Works!" when I type and enter localhost, so that isn't the problem either. So I don't know why my signup.php won't run on my localhost. I even included /opt/lampp in the url before I added where file is found because under the tab called volumes in XAMPP, it says /opt/lampp, that didn't work either.
swn
 
Posts: 4
Joined: 07. April 2019 17:44
XAMPP version: 7.3.3-1
Operating System: MAC

Re: My localhost works but it won't show the index of php fi

Postby Nobbie » 09. April 2019 02:09

swn wrote:It won't even show the list of files in the folder I created and saved in the right place.


No, you didnt. You saved it in the wrong place.

swn wrote:I even included /opt/lampp in the url before I added where file is found because under the tab called volumes in XAMPP, it says /opt/lampp, that didn't work either.


Aha - thx for that hint. Obviously you installed the Xampp-VM version, which runs in a virtual machine and NOT in your local filesystem. You obviously have no or the wrong understanding how Xampp-VM works. I do NOT recommend to use Xampp-VM (as you can see, it is difficult to handle and difficult to understand), therefore uninstall/delete this Xampp-VM installation, then download and install a normal (non-VM) version for Xampp, finally put your files to the DocumentRoot of Xampp (i do not have a MacOS, but it should be similar to /Applications/Xampp/xamppfiles/htdocs or so, you will find out).

It is on you to follow my advice, but as long as you do NOT, you WILL NOT succeed. Youre decision.
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: My localhost works but it won't show the index of php fi

Postby r.jc » 09. April 2019 04:57

swn wrote:Aha - thx for that hint. Obviously you installed the Xampp-VM version, which runs in a virtual machine and NOT in your local filesystem. You obviously have no or the wrong understanding how Xampp-VM works. I do NOT recommend to use Xampp-VM (as you can see, it is difficult to handle and difficult to understand), therefore uninstall/delete this Xampp-VM installation, then download and install a normal (non-VM) version for Xampp, finally put your files to the DocumentRoot of Xampp (i do not have a MacOS, but it should be similar to /Applications/Xampp/xamppfiles/htdocs or so, you will find out).


I think do that. i try to back roll installing my xampp.
success.
r.jc
 
Posts: 8
Joined: 09. April 2019 04:45
XAMPP version: 7.3.3
Operating System: Windows 7 64bit

Re: My localhost works but it won't show the index of php fi

Postby swn » 09. April 2019 06:10

Nobbie wrote:
Aha - thx for that hint. Obviously you installed the Xampp-VM version, which runs in a virtual machine and NOT in your local filesystem. You obviously have no or the wrong understanding how Xampp-VM works. I do NOT recommend to use Xampp-VM (as you can see, it is difficult to handle and difficult to understand), therefore uninstall/delete this Xampp-VM installation, then download and install a normal (non-VM) version for Xampp, finally put your files to the DocumentRoot of Xampp (i do not have a MacOS, but it should be similar to /Applications/Xampp/xamppfiles/htdocs or so, you will find out).

It is on you to follow my advice, but as long as you do NOT, you WILL NOT succeed. Youre decision.

@Nobble, THANK YOU THANK YOU THANK YOU!!!!!!! I'm all excited and happy :D because this is a breakthrough for me. I followed your instructions and now I can finally see and click on all my files I created. You made my day. I can finally proceed with making my php login files and actually see what they look like on my localhost.
swn
 
Posts: 4
Joined: 07. April 2019 17:44
XAMPP version: 7.3.3-1
Operating System: MAC

Re: My localhost works but it won't show the index of php fi

Postby swn » 09. April 2019 06:16

r.jc wrote:
I think do that. i try to back roll installing my xampp.
success.

Thank you. I installed and uninstalled XAMPP 10 times lol :lol:. XAMPP finally worked after the 11th time.
swn
 
Posts: 4
Joined: 07. April 2019 17:44
XAMPP version: 7.3.3-1
Operating System: MAC


Return to XAMPP for macOS

Who is online

Users browsing this forum: No registered users and 10 guests