|
|
PHP problem
|
|
|
|
Forum Regular
Join Date: May 2003
Location: J�mtland - Sweden
Status:
Offline
|
|
Hi there!
I have a problem with displaying my PHP-pages.. The phpInfo() works fine but it won't parse anything like echo, include or.. well anything else.. I have tried to re-install the php package (the one found at entropy.com) but it wont start. I've restarted apache many times as well as try a reboot to see if the problem was that the php-modul wasn't correctly loaded or something. but that don't seem to be the problem. I think it happened after I installed Panther. But I am not sure since it was quite a time since I sat down to write some nice php-code.
I think that is kinda weird that it parses the phpInfo function but not simple things as echo...
Anyone who has any idea of what the problem could be?
|
Mighty3k @ #MacNN
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Mar 2002
Location: Clogland
Status:
Offline
|
|
Are you getting error messages or unparsed code?
|
|
|
|
|
|
|
|
|
Forum Regular
Join Date: May 2003
Location: J�mtland - Sweden
Status:
Offline
|
|
Nope. Nothing.
It seems like it is just skipping the php-tags.
|
Mighty3k @ #MacNN
|
|
|
|
|
|
|
|
Senior User
Join Date: Dec 2002
Status:
Offline
|
|
it sounds like you haven't added the type to your apache conf file.
in httpd.conf add the line:
AddType application/x-httpd-php .php
|
Travis Sanderson
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: Nov 2001
Location: Are Eye
Status:
Offline
|
|
can you post a sample of your source that doesn't work? It may make it easier to troubleshoot.
And just because I have to ask: you are using <?php tags ?> right? Or at least <? these tags ?> to surround your code, aren't you?
|
|
|
|
|
|
|
|
|
Forum Regular
Join Date: May 2003
Location: J�mtland - Sweden
Status:
Offline
|
|
Yes!!
This works: <?php phpInfo(); ?>
This does not work: <?php include('_inc/file.php'); ?>
Nor does this: <?php echo "hello world" ?>
Yesterday apache wouldn't even start, but now after reboot i does however..
I think I need to reinstall panther and do a format or something. I am going nuts.
|
Mighty3k @ #MacNN
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Mar 2002
Location: Clogland
Status:
Offline
|
|
Originally posted by 1c3:
Nor does this: <?php echo "hello world" ?>
// missing a semi-colon
<?php
echo "hello world";
?>
|
|
|
|
|
|
|
|
|
Forum Regular
Join Date: Apr 2003
Location: Toronto, Canada
Status:
Offline
|
|
|
|
|
|
|
|
|
|
|
Grizzled Veteran
Join Date: Jun 2001
Location: Melbourne, Australia
Status:
Offline
|
|
Check to see that PHP is enclosed by <?php ?> and not <? ?> - sometimes default installations have short tags turned off.
|
Computer thez nohhh...
|
|
|
|
|
|
|
|
Forum Regular
Join Date: May 2003
Location: J�mtland - Sweden
Status:
Offline
|
|
Originally posted by skalie:
// missing a semi-colon
<?php
echo "hello world";
?>
It should still work since ?> closes the last instance written. the semi-colon is not required if in this example echo is right before the closing-tag.
And I have checked, I am using <?php ?> and not <? ?>.
there must be something wrong with the module. Maybe I should ask the guy over at entropy's instead. Thanks anyways.
|
Mighty3k @ #MacNN
|
|
|
|
|
|
|
|
Forum Regular
Join Date: Apr 2003
Location: Toronto, Canada
Status:
Offline
|
|
I tried what you suggested and added 'php' to all instances of '<?' I came across. However, it still does not work. Hopefully if 1c3 learns something over in the Entropy forums he will share it with us!
|
|
|
|
|
|
|
|
|
Fresh-Faced Recruit
Join Date: Apr 2004
Status:
Offline
|
|
I believe the latest php package has display_errors = Off as default. Check your php.ini file (which should be located at usr/local/php/lib/php.ini) and see if its off. Toggle it to On, and you should be able to see what errors are occurring (which is the most likely suspect, given what you've described)
hth,
fc
|
|
|
|
|
|
|
|
|
Forum Regular
Join Date: Apr 2003
Location: Toronto, Canada
Status:
Offline
|
|
Okay. I have done that. What should I look for?
|
|
|
|
|
|
|
|
|
Forum Regular
Join Date: Apr 2003
Location: Toronto, Canada
Status:
Offline
|
|
Okay. Well, having fooled around a bit, I think I've discovered the problem. My permissions weren't set correctly. The PHP was working fine, but my server wouldn't let others see the PHP pages.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|