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

Tuesday, February 15, 2022

[FIXED] Using HOST_WWW_ROOT on the MAMP stack

 February 15, 2022     localhost, mamp, mysql, php     No comments   

Issue

I'm currently trying to teach myself PHP and MySQL using the MAMP stack. Everything has been going good up until I came across this problem.

I am reading a book and completing the exercises as I go and I'm at the point where I have to let the user upload an image and then store that image on the web server. The book states that to do that, you make use of HOST_WWW_ROOT to set the location for the web files that will be uploaded.

I have done exactly how the book says to, however it is not working.

Is it possible to use this HOST_WWW_ROOT on localhost or can it only be used on a live server?


Solution

Every book will use something like SITE_ROOT or HOST_WWW_ROOT to refer to the location where your web server's public directory is located at.

MAMP FAQ:

Where should I store my HTML and PHP pages?

By default, PHP and HTML Pages should be stored inside the MAMP "htdocs" folder which is located in the MAMP Application directory /Applications/MAMP. This folder is called "Document Root". You can change the path for the Document Root in the MAMP application's Preferences Panel:

enter image description here

Now, depending on the platform you are developing your application on, some books would use something like SITE_ROOT, WWW_PUB, WWW_ROOT, etc. but they all refer, as you said, to the location where your 'web files' are.

See if there are some side notes indicating the book conventions.



Answered By - Saul Martínez
  • 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