basic questions on Apache scope, servers, etc.
Posted: Tue Jul 07, 2009 6:00 pm
Background: I'm supposed to set up a server at work, on a PC running Windows XP. I've taken a course in PHP, which showed us how to set up XAMPP, use PHP, and use MySQL. I installed and ran XAMPP on this PC and I now have Apache 2.2 and MySQL running as services. I also created a MySQL database with the tables and columns I want. But now I'm completely lost as to basics, which I was never taught, and I can't find online. Here are my basic questions:
When developing PHP programs they can be run only with Apache when in the "C:\xampp\htdocs\" folder. For example, the file...
C:\xampp\htdocs\form.php
...can be run only with the path name...
http://localhost/form.php
...in the browser (Internet Explorer), correct? However, when I created a MySQL database called "readings" it looks like it was automatically placed at the path...
C:\xampp\mysql\data\readings
...so how can anything work at all? Can PHP access this database outside of the HTDOCS folder? How can somebody on a client machine see my PHP web page? What folder do they go to? Certainly not HTDOCS, correct? What URL do I give them? I know that web hosting companies like LunarPages have Apache running with scope such that the users can run PHP programs from any folder, but I don't see how they can do that with the HTDOCS limitation. Or should I somehow use another program for installing Apache, like Apache on its own? Does the installer package make any difference? Am I doing something fundamentally wrong, like needing to use a professional web hosting company for our project? It seems I've learned a lot of detail but nothing about the big picture of how to get anything working at a professional level.
When developing PHP programs they can be run only with Apache when in the "C:\xampp\htdocs\" folder. For example, the file...
C:\xampp\htdocs\form.php
...can be run only with the path name...
http://localhost/form.php
...in the browser (Internet Explorer), correct? However, when I created a MySQL database called "readings" it looks like it was automatically placed at the path...
C:\xampp\mysql\data\readings
...so how can anything work at all? Can PHP access this database outside of the HTDOCS folder? How can somebody on a client machine see my PHP web page? What folder do they go to? Certainly not HTDOCS, correct? What URL do I give them? I know that web hosting companies like LunarPages have Apache running with scope such that the users can run PHP programs from any folder, but I don't see how they can do that with the HTDOCS limitation. Or should I somehow use another program for installing Apache, like Apache on its own? Does the installer package make any difference? Am I doing something fundamentally wrong, like needing to use a professional web hosting company for our project? It seems I've learned a lot of detail but nothing about the big picture of how to get anything working at a professional level.