View Source Code from HTML showed underlying PHP script

Hi,
I just started on the book PHP& My SQL Novice to Ninja. I got a 403 Forbidden error after entering the host address in the browser bar (http://192.168.10.10/). I was wondering if this has anything to do with the browser setting? I’m using chrome.
Thanks!

Your post title and the question seem to be two different things @tzuyiyang. Can you explain in more detail?

A 403 error is a server response. It is not affected by your browser.

1 Like

Do you get the same response if you put the word localhost into the browser bar? If so, you’ve set something up incorrectly. If not, you’ve tried to connect to another computer on your network that is running a web server that is denying you access.

Yes, you’re right. Sorry about that.
I ran these in Git Bash before running the vagrant up command.

cd my_Project
mkdir -P Project/public 
 bin/folderfix.sh

I then created a Hello world html file in the public directory. Afterwards I typed https://192.168.10.10/ in my browser bar.

Thanks for your help.

Sorry would you mind clarifying a bit,
I tried localhosthttps://192.168.10.10/
localhost://192.168.10.10/
localhost:192.168.10.10/

But these would take me to Google search results.
Thanks for your help.

I don’t mean localhost + anything else. Just the word “localhost”.

I don’t use Vagrant so I can’t tell what’s the problem, but if it’s all the same, it could be because you don’t have permission to that file. If Vagrant doesn’t do anything to the folder permission on the parent folder, you will actually not have the right permission to access that folder hence 403 error. If your VM is running on Linux, try doing a

sudo chmod -R 0777 {FOLDER_LOCATION}

This should change the folder permission to fully global. Remember to change {FOLDER_LOCATION} with your actual folder location and replace it including the curly brace.

1 Like

I see.
“The site can’t be reached” was displayed on the browser.
Message below read “localhost refused to connect.”

Thanks for your clarification.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.