jfredrickson - Jun 6, 2005 - 3:23 pm
I have set up WebServerXKit which installs and manages phpMyAdmin, MySQL, PHP and Apache. Everything seems to be running fine with phpMyAdmin, but I can't figure out how to view my php files in the browser. It was my understanding that I can just place files in the Sites folder and that I can access them in my browser. However, I can't figure out how to access them.
How can I view my php files on localhost in my browser?
tubajensen - Jun 6, 2005 - 5:11 pm
John,
you can view a file, for example: /Library/WebServer/Documents/your_file.php by typing
http://localhost/your_file.php in the address window of your browser. This means you place files in /Library/WebServer/Documents.
Make sure you have "Personal Web Sharing" turned on in your "Sharing" preferences.
--------
Did this answer your question?
Allan
jfredrickson - Jun 6, 2005 - 6:08 pm
Ok, I didn't have a folder called WebServer in my Library folder, so I created it and the subfolder Documents. I placed my php documents in there and tried accessing them at
http://localhost/file.php, but it couldn't find the file. I tried it with Personal Web Sharing on and off, and it didn't make a difference. The weird thing is that phpMyAdmin is only accessible when Personal Web Sharing is off. It is located at
http://localhost/phpMyAdmin/ I wonder how there could have been no WebServer folder in my library as phpMyAdmin appears to be in the root folder for localhost. Maybe the root folder is somewhere else?
jfredrickson - Jun 6, 2005 - 6:08 pm
Ok, I didn't have a folder called WebServer in my Library folder, so I created it and the subfolder Documents. I placed my php documents in there and tried accessing them at
http://localhost/file.php, but it couldn't find the file. I tried it with Personal Web Sharing on and off, and it didn't make a difference. The weird thing is that phpMyAdmin is only accessible when Personal Web Sharing is off. It is located at
http://localhost/phpMyAdmin/ I wonder how there could have been no WebServer folder in my library as phpMyAdmin appears to be in the root folder for localhost. Maybe the root folder is somewhere else?
tubajensen - Jun 7, 2005 - 9:14 am
John,
view your computer’s website at
http://localhost/ or your personal website at
http://localhost/~your_username/ . The documents for the computer's website go into /Library/WebServer/Documents/ , those for your personal website should be here: ~/Sites .
A reason you may not be able to view documents in your Sites folder could be that your home directory ~ does not have the +x flag for everyone. You could change this by issuing the command chmod +x ~ in Terminal.
--------
Please tell how it went.
Allan
jfredrickson - Jun 7, 2005 - 2:45 pm
Ok, I don't know how it is supposed to work, but I was able to track the location of phpMyAdmin which comes up at
http://localhost/ when "Personal Web Sharing" is off. It was in the following folder: /usr/local/apache2/htdocs/ I placed all my files in that folder, and now they come up fine at localhost. The interesting thing is that this only works when "Personal Web Sharing" is off. I guess this isn't how you are supposed to do it, but it seems to work for me.
tubajensen - Jun 7, 2005 - 2:55 pm
Good,
if you want more information I could reopen your question for other techs to view.
--------
Allan