View previous topic :: View next topic |
Author |
Message |
Nivlac n00b
Joined: 16 Oct 2010 Posts: 8 Location: Washington, USA
|
Posted: Sat Oct 16, 2010 11:13 pm Post subject: Problem getting PHP to work properly |
|
|
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 |
|
|
whig l33t
Joined: 27 Nov 2004 Posts: 973 Location: New Zealand
|
Posted: Sun Oct 17, 2010 3:09 am Post subject: |
|
|
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 |
|
|
whig l33t
Joined: 27 Nov 2004 Posts: 973 Location: New Zealand
|
Posted: Sun Oct 17, 2010 3:20 am Post subject: |
|
|
Of course. php.ini has a setting for this: display_errors = On
It is usually Off for security reasons. |
|
Back to top |
|
|
Nivlac n00b
Joined: 16 Oct 2010 Posts: 8 Location: Washington, USA
|
Posted: Mon Oct 18, 2010 4:23 pm Post subject: |
|
|
Sigh.... figures lol. I was putting instead of . Its been a while. Sorry for the dumb question, but thanks for the response! |
|
Back to top |
|
|
Anarcho Advocate
Joined: 06 Jun 2004 Posts: 2970 Location: Germany
|
Posted: Wed Oct 20, 2010 6:06 am Post subject: |
|
|
Wasn't there a php.ini setting to also allow only <? ?>? _________________ ...it's only Rock'n'Roll, but I like it! |
|
Back to top |
|
|
tomk Bodhisattva
Joined: 23 Sep 2003 Posts: 7221 Location: Sat in front of my computer
|
Posted: Wed Oct 20, 2010 8:50 am Post subject: |
|
|
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 |
|
|
|