User Name
Password
AppleNova Forums » Programmer's Nook »

PHP installation issues


Register Members List Calendar Search FAQ Posting Guidelines
PHP installation issues
Thread Tools
ThunderPoit
Making sawdust
 
Join Date: May 2004
Location: Minnesota
 
2006-03-15, 17:56

So I recently bought myself a TiBook from Luca and decided to use it to teach myself some HTML, CSS, and PHP.
I have had no problems with apache on this machine, however, I am having issues with PHP.
I downloaded and installed the PHP package from Marc Lyanage's site. I followed the instructions to install it (Download, double click, install), but when I try to test it out, I get nothing.
The simple line [PHP]<? phpinfo(); ?>[/PHP] doesn't give me anything at all.
I tried installing this on my other Mac, a G4 867, and I got the same result. Both machines are running 10.4.5.
I know I've had this package working on my powermac before, but I can't remember if this was before or after I upgraded to 10.4.5. I had recently wiped and reinstalled on it, so the original one is no longer there. Does anyone have any suggestions?
  quote
Brad
Selfish Heathen
 
Join Date: May 2004
Location: Zone of Pain
 
2006-03-15, 18:00

Just to rule out the obvious, you're accessing that through the localhost web server, not just by opening the file in your browser, right?

Something like:
http://127.0.0.1/~davelegatt/test.php

The quality of this board depends on the quality of the posts. The only way to guarantee thoughtful, informative discussion is to write thoughtful, informative posts. AppleNova is not a real-time chat forum. You have time to compose messages and edit them before and after posting.
  quote
ThunderPoit
Making sawdust
 
Join Date: May 2004
Location: Minnesota
 
2006-03-15, 18:03

http://localhost/~dave/test.php
does that work?

edit: Just tried it with the ip address instead of local host, still no go
  quote
ThunderPoit
Making sawdust
 
Join Date: May 2004
Location: Minnesota
 
2006-03-15, 18:06

one last bit, the page doesn't even appear to get parsed by the php module. the source of the page that comes up just shows the original function
  quote
Brad
Selfish Heathen
 
Join Date: May 2004
Location: Zone of Pain
 
2006-03-15, 18:08

Is test.php in your home Sites folder? That's where it should be for this to work. Assuming your home folder is names dave, try:

http://127.0.0.1/~dave/test.php

127.0.0.1 always points to localhost, FYI.

The quality of this board depends on the quality of the posts. The only way to guarantee thoughtful, informative discussion is to write thoughtful, informative posts. AppleNova is not a real-time chat forum. You have time to compose messages and edit them before and after posting.
  quote
ThunderPoit
Making sawdust
 
Join Date: May 2004
Location: Minnesota
 
2006-03-15, 18:13

yes, it is in my sites folder. ive dabbled in php before. i also get the same resuld if i place it directly in /library/webserver/documents. ive installed this on my parents imac as well, it was also running 10.4.5, same result
  quote
Gargoyle
http://ga.rgoyle.com
 
Join Date: May 2004
Location: In your dock hiding behind your finder icon!
 
2006-03-15, 18:27

Have you restarted Apache?
  quote
ThunderPoit
Making sawdust
 
Join Date: May 2004
Location: Minnesota
 
2006-03-15, 18:30

yup, in fact, the installer does it for you.
  quote
rollercoaster375
Senior Member
 
Join Date: Mar 2005
Location: UIllinois (Champaign, IL)
Send a message via AIM to rollercoaster375 Send a message via MSN to rollercoaster375 Send a message via Yahoo to rollercoaster375 Send a message via Skype™ to rollercoaster375 
2006-03-15, 19:32

Take a look at httpd.conf... Maybe your filetype isn't accociated?
  quote
ThunderPoit
Making sawdust
 
Join Date: May 2004
Location: Minnesota
 
2006-03-15, 19:40

the installer added this to my httpd.conf

Code:
# begin entropy.ch PHP module activation Include /usr/local/php5/httpd.conf.php # end entropy.ch PHP module activation # begin entropy.ch PHP module activation AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps DirectoryIndex index.html index.php # end entropy.ch PHP module activation
i checked the forums at the site, tried registering to ask for any help from somone there, however, they have manual account activation, so im still waiting for the ability to post
  quote
Brad
Selfish Heathen
 
Join Date: May 2004
Location: Zone of Pain
 
2006-03-15, 21:53

That looks right.

Another question: which version did you download? It should be the "PHP 5.1.2 for Apache 1.3" or "PHP 4.3.11 for Apache 1.3" setup.

The quality of this board depends on the quality of the posts. The only way to guarantee thoughtful, informative discussion is to write thoughtful, informative posts. AppleNova is not a real-time chat forum. You have time to compose messages and edit them before and after posting.
  quote
ThunderPoit
Making sawdust
 
Join Date: May 2004
Location: Minnesota
 
2006-03-15, 21:58

5.1.2 for apache 1.3
  quote
ThunderPoit
Making sawdust
 
Join Date: May 2004
Location: Minnesota
 
2006-03-16, 23:14

I am Sofa King
We Todd Ed.

Solution:
Instead of this:

<? phpinfo();?>


I need to use this:

<?php phpinfo(); ?>


sorry for leading anyone on a wild goose chase...
  quote
Brad
Selfish Heathen
 
Join Date: May 2004
Location: Zone of Pain
 
2006-03-17, 10:23



Yeah, that might make a difference.

Some PHP installations don't require that. I think PHP4's defaults don't and that's why I didn't catch it (I'm using 4). I guess PHP5's defaults are a little stricter.

The quality of this board depends on the quality of the posts. The only way to guarantee thoughtful, informative discussion is to write thoughtful, informative posts. AppleNova is not a real-time chat forum. You have time to compose messages and edit them before and after posting.
  quote
drewprops
Space Pirate
 
Join Date: May 2004
Location: Atlanta
 
2006-03-17, 11:08

I guess that I thought that PHP came automatically with OS X and that I was just too dumb to install it.... appears that I'm wrong (again) eh? Can any of you guys explain in simple terms how you actually use PHP when you've installed it? Do you have to put all your PHP files into a certain directory? It would sure be nifty to be able to run and test all my files locally.....

Steve Jobs ate my cat's watermelon.
Captain Drew on Twitter
  quote
rollercoaster375
Senior Member
 
Join Date: Mar 2005
Location: UIllinois (Champaign, IL)
Send a message via AIM to rollercoaster375 Send a message via MSN to rollercoaster375 Send a message via Yahoo to rollercoaster375 Send a message via Skype™ to rollercoaster375 
2006-03-17, 11:22

PHP 5 defaults to short tags on... The Package must have that option changed.

drewprops: It does. All you need to do is make a few edits to your built-in Apache's httpd.conf.
  quote
Brad
Selfish Heathen
 
Join Date: May 2004
Location: Zone of Pain
 
2006-03-17, 11:23

Quote:
Originally Posted by drewprops
I guess that I thought that PHP came automatically with OS X and that I was just too dumb to install it.... appears that I'm wrong (again) eh? Can any of you guys explain in simple terms how you actually use PHP when you've installed it? Do you have to put all your PHP files into a certain directory? It would sure be nifty to be able to run and test all my files locally.....
Once installed, just end the filename in PHP and put them in a folder that is accessible by Apache like your home Sites folder. Then, access the URL like I described above:

http://127.0.0.1/~yourname/myfile.php

The quality of this board depends on the quality of the posts. The only way to guarantee thoughtful, informative discussion is to write thoughtful, informative posts. AppleNova is not a real-time chat forum. You have time to compose messages and edit them before and after posting.
  quote
ast3r3x
25 chars of wasted space.
 
Join Date: May 2004
Send a message via AIM to ast3r3x  
2006-03-17, 11:25

If it's on your machine, apache will parse any PHP code in a .php file when it's serving it.

So as long as your files end in .php you can put all your HTML and PHP code in there, it will parse, and give the end result to the user.

index.php =
Code:
<html> <body> <?php echo("damn i'm slick <br />\r\n"); echo("and life is good!"); ?> </body> </html>
what they see =
Code:
<html> <body> damn i'm slick and life is good! </body> </html>
easy, peasy, japaneasy!
  quote
Posting Rules Navigation
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Post Reply

Forum Jump
Thread Tools
Similar Threads
Thread Thread Starter Forum Replies Last Post
Stability issues after installing 10.4.3 ecs Apple Products 0 2005-12-11 07:12
PHP: making index files work drewprops Programmer's Nook 7 2005-11-21 12:15
PHP & Apache 2 ast3r3x Genius Bar 0 2005-03-16 20:38
Generating XML for Newsfeed (MovableType and PHP) drewprops Genius Bar 3 2005-01-22 00:32
HELP! URGENT. DOWNGRADE PHP 5.0.1 to 4.3.6 hype.it Genius Bar 2 2004-08-31 19:15


« Previous Thread | Next Thread »

All times are GMT -5. The time now is 15:53.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004 - 2024, AppleNova