New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
Web Design and Hosting Creating sites, scripting, and hosting discussions.

How to test php offline?


Thread Closed

 
Thread Tools
x5452

 
Member Since: Dec 10, 2007
Posts: 6
x5452 is on a distinguished road

x5452 is offline
I am new to web stuff, and am running 10.5.4. I am trying to find if it is possible to test php offline, because where I volunteer in the day has no wi-fi, but I try to work on some php im learning.
I have php installed, obviously, as well as apache. I have uncommented the lines in httpd.conf file, and I have enabled websharing in system prefs.
I created a simple test.php file that calls phpinfo(), and it works I know because I ran it from terminal. But when I put the file into /library/websharing/documents and point localhost to it, all it does is display the code, not the info. Isn't it supposed to interpret the php that way? If not, is there anyway to do that?
Thank you for help!
dekan

 
dekan's Avatar
 
Member Since: Mar 16, 2007
Posts: 756
dekan is a jewel in the roughdekan is a jewel in the rough

dekan is offline
Hey!

There is a software called XAMPP, which is for free and installs an apache server, SQL, ... on your mac. Easy to use. I love it for web development.

http://www.apachefriends.org/en/xampp-macosx.html

x5452

 
Member Since: Dec 10, 2007
Posts: 6
x5452 is on a distinguished road

x5452 is offline
I already have php and apache installed, thats why im stuck I think.
For example, if I open a browser and type in http://localhost I get an apache start page saying that installation of apache was succesful...
Del

 
Member Since: Dec 24, 2006
Location: N. Ireland
Posts: 901
Del has a spectacular aura about
Mac Specs: Mac Pro 2xQuad core 2.8GHZ

Del is offline
copy your php file in to the htdocs folder of your apache server then point your browser at the file you wish to test

eg

http://localhost/testthis.php
x5452

 
Member Since: Dec 10, 2007
Posts: 6
x5452 is on a distinguished road

x5452 is offline
what is a hotdocs folder?
I had been putting the files into Mac->Library->webserver->documents
wheelguy

 
wheelguy's Avatar
 
Member Since: Jun 18, 2006
Location: Minneapolis
Posts: 191
wheelguy will become famous soon enough
Mac Specs: MacBook Pro

wheelguy is offline
the htdocs folder is the "local web server" this is where you would put your folder containing all of the html, php, images folder, other folders. Generally you would view through a web browser on your machine with the address http://localhost/webfoldername/filename.php
Check out www.apachefriends.org they have an apache/mysql setup for mac called xampp.

If you aren't fired with enthusiasm, you will be fired with enthusiasm. -Vince Lombardi
Josso

 
Josso's Avatar
 
Member Since: Jun 07, 2008
Location: Denmark, Europe
Posts: 30
Josso is on a distinguished road
Mac Specs: None... :(

Josso is offline
I think that MAMP sounds way easier. (Something a Mac worth)

- Josso!
Know more than some new Mac-users, but they're so expensive.
Hope they'll be it worth.
catthepirate

 
Member Since: Nov 25, 2008
Posts: 5
catthepirate is on a distinguished road

catthepirate is offline
Quote:
Originally Posted by wheelguy View Post
the htdocs folder is the "local web server" this is where you would put your folder containing all of the html, php, images folder, other folders. Generally you would view through a web browser on your machine with the address http://localhost/webfoldername/filename.php
Check out apache friends - very easy apache, mysql, php and perl installation without hassles they have an apache/mysql setup for mac called xampp.
I'm having issues with this part. It simply will not connect to htdocs!
wheelguy

 
wheelguy's Avatar
 
Member Since: Jun 18, 2006
Location: Minneapolis
Posts: 191
wheelguy will become famous soon enough
Mac Specs: MacBook Pro

wheelguy is offline
Make sure that you have started the xampp program, it does not automatically run on startup.

If you aren't fired with enthusiasm, you will be fired with enthusiasm. -Vince Lombardi
centered effect

 
Member Since: Dec 31, 2005
Posts: 24
centered effect is on a distinguished road

centered effect is offline
I second MAMP as well. Select the htdocs folder, right click, make alias, then drag that to your home folder (I named mine www). Then start up MAMP and you are good to go.

PowerBook G4 15" 1.5Ghz | 2GB PC2700 | 80GB HDD | OSX 10.4.11
Turk182

 
Member Since: Jan 30, 2009
Posts: 48
Turk182 is an unknown at this point

Turk182 is offline
Quote:
Originally Posted by Josso View Post
I think that MAMP sounds way easier. (Something a Mac worth)
have used this for a long time. works great. even has a widget to turn on/off your php server. great for testing.
nothing

 
Member Since: Jan 31, 2009
Posts: 6
nothing is on a distinguished road

nothing is offline
type this into google
typo3

get that and yout laughing
it sets up php and mysql localy all by its self and it runs smoooooth

its great basically

Thread Closed


« Buying your own URL address | Who blogs? »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
php won't send to email? reholmes OS X - Development and Darwin 0 07-16-2007 04:13 AM
PHP email form won't work reholmes OS X - Operating System 0 07-15-2007 03:39 PM
Offline php and MYSQL server. StonePatch OS X - Apps and Games 2 09-10-2006 11:52 AM
Setting up PHP and PHP Nuke EvoMac Web Design and Hosting 2 02-18-2005 12:38 PM
Upgrading PERL Forum Setup, MySQL, etc. ssotti OS X - Development and Darwin 0 11-29-2003 11:16 AM

All times are GMT -4. The time now is 09:14 PM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?