Making sawdust
Join Date: May 2004
Location: Minnesota
|
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 |
Selfish Heathen
Join Date: May 2004
Location: Zone of Pain
|
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 |
Making sawdust
Join Date: May 2004
Location: Minnesota
|
http://localhost/~dave/test.php
does that work? edit: Just tried it with the ip address instead of local host, still no go |
quote |
Making sawdust
Join Date: May 2004
Location: Minnesota
|
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 |
Selfish Heathen
Join Date: May 2004
Location: Zone of Pain
|
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 |
Making sawdust
Join Date: May 2004
Location: Minnesota
|
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 |
http://ga.rgoyle.com
Join Date: May 2004
Location: In your dock hiding behind your finder icon!
|
Have you restarted Apache?
|
quote |
Making sawdust
Join Date: May 2004
Location: Minnesota
|
yup, in fact, the installer does it for you.
|
quote |
Senior Member
|
Take a look at httpd.conf... Maybe your filetype isn't accociated?
|
quote |
Making sawdust
Join Date: May 2004
Location: Minnesota
|
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 |
Selfish Heathen
Join Date: May 2004
Location: Zone of Pain
|
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 |
Making sawdust
Join Date: May 2004
Location: Minnesota
|
5.1.2 for apache 1.3
|
quote |
Making sawdust
Join Date: May 2004
Location: Minnesota
|
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 |
Selfish Heathen
Join Date: May 2004
Location: Zone of Pain
|
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 |
Space Pirate
Join Date: May 2004
Location: Atlanta
|
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.....
|
quote |
Senior Member
|
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 |
Selfish Heathen
Join Date: May 2004
Location: Zone of Pain
|
Quote:
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 |
25 chars of wasted space.
|
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 |
|
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 |