PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, July 2, 2022

[FIXED] How to run PHP files on XAMMP on A Mac

 July 02, 2022     macos, php, xampp     No comments   

Issue

I have saved a PHP file to my Applications/XAMMP/htdocs directory and I want to run it in a browser.

I have used all sorts of url combinations including: http://localhost/xammp/htdocs/HelloWord.php http://localhost/xammp/HelloWord.php

amongst others and I cannot find the right url.

I am using XAMPP on a Mac Majove.


Solution

If you installed the XAMPP VM version, then you can probably access it via http://192.168.64.2/HelloWord.php (check the General tab in the XAMPP app for the IP address)

If you installed the native version, then I guess it is http://localhost/HelloWord.php

The htdocs/ folder is the document root. Its content is served under the server address. Neither the xampp nor the htdocs folder will be part of the URL. The paths are relative to the document root, and you shouldn't be able to access parent directories above htdocs/ (although server-side code such as PHP has access to the file system and may work with files outside of the document root).



Answered By - CodeManX
Answer Checked By - Candace Johnson (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing