Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Problem getting PHP to work properly
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Nivlac
n00b
n00b


Joined: 16 Oct 2010
Posts: 8
Location: Washington, USA

PostPosted: Sat Oct 16, 2010 11:13 pm    Post subject: Problem getting PHP to work properly Reply with quote

I've been trying to get PHP running with apache2 for a couple days now, and I can't figure out what is wrong.

If i run '/etc/init.d/apache2 module' it shows "php5_module (shared)"

I have added the "-D PHP5" to my APACHE2_OPTS variable.

Everything looks like it should be working, but PHP content renders blank. Also, if I navigate to the server it chooses index.html rather than index.php for the default web page.

Any ideas?


EDIT: I seem to be having the same issue as the guy here https://forums.gentoo.org/viewtopic-t-843920.html, which he solved by 'enabling the redirect'. What is this? I've looked everywhere online and I can't figure out what this redirect is or what he did.
Back to top
View user's profile Send private message
whig
l33t
l33t


Joined: 27 Nov 2004
Posts: 973
Location: New Zealand

PostPosted: Sun Oct 17, 2010 3:09 am    Post subject: Reply with quote

I suspect a bug in the php script. Sometimes if I have a php script bug - like a missing ; for instance - the script doesn't run and I'm left with a blank page. No error message. Create the tiniest php script and test:
Code:
<?php print "hello"; ?>

Increase the script size slowly with retesting.
Back to top
View user's profile Send private message
whig
l33t
l33t


Joined: 27 Nov 2004
Posts: 973
Location: New Zealand

PostPosted: Sun Oct 17, 2010 3:20 am    Post subject: Reply with quote

Of course. php.ini has a setting for this: display_errors = On

It is usually Off for security reasons.
Back to top
View user's profile Send private message
Nivlac
n00b
n00b


Joined: 16 Oct 2010
Posts: 8
Location: Washington, USA

PostPosted: Mon Oct 18, 2010 4:23 pm    Post subject: Reply with quote

Sigh.... figures lol. I was putting
Code:
<? ... ?>
instead of
Code:
<?PHP ... ?>
. Its been a while. Sorry for the dumb question, but thanks for the response!
Back to top
View user's profile Send private message
Anarcho
Advocate
Advocate


Joined: 06 Jun 2004
Posts: 2970
Location: Germany

PostPosted: Wed Oct 20, 2010 6:06 am    Post subject: Reply with quote

Wasn't there a php.ini setting to also allow only <? ?>?
_________________
...it's only Rock'n'Roll, but I like it!
Back to top
View user's profile Send private message
tomk
Bodhisattva
Bodhisattva


Joined: 23 Sep 2003
Posts: 7221
Location: Sat in front of my computer

PostPosted: Wed Oct 20, 2010 8:50 am    Post subject: Reply with quote

Anarcho wrote:
Wasn't there a php.ini setting to also allow only <? ?>?

Yes but it's not recommended to use this format if your code needs to be portable:

/etc/php/apache2-php5/php.ini:
; Allow the <? tag.  Otherwise, only <?php and <script> tags are recognized.
; NOTE: Using short tags should be avoided when developing applications or
; libraries that are meant for redistribution, or deployment on PHP
; servers which are not under your control, because short tags may not
; be supported on the target server. For portable, redistributable code,
; be sure not to use short tags.
short_open_tag = On

_________________
Search | Read | Answer | Report | Strip
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum