0

I just installed Xampp on my mac. I can easily reach my phpadmin page with entring the address http://192.168.64.2/phpmyadmin/. But I cannot run my php file that I've already created and save it in htdocs in lampp as the following addres : http://192.168.64.2/opt/lampp/htdocs/myapp/First.php

that gives me the error object not found.

since I'm new in php and using Xampp, I highly appreciate if anyone can help me to fix this problem. Thank you so much

Steve
  • 17
  • 7
  • 1
    try http://192.168.64.2/myapp/First;php ... this is a URL, whilst you are providing a file-system path. Normally, the web root directory is /opt/lampp/htdocs , and url's are relative to the root. – YvesLeBorg Aug 18 '18 at 17:00
  • Thank you for your comment. It worked – Steve Aug 18 '18 at 17:11

1 Answers1

0

"htdocs" is normally the DOCUMENT_ROOT (that localhost refers to), so you would not normally specify this in the URL.

That said, I would expect the URL to be http://localhost/file_name.php. To be honest, if you are having to specify "htdocs" in the URL then the DocumentRoot (in your server config) is probably set incorrectly.

Hope this can give you some insightful.

quintumnia
  • 172
  • 1
  • 2
  • 15