You are not logged in.

#1 2007-10-12 12:53:21

cu3edweb
Member
From: USA
Registered: 2007-10-07
Posts: 291

PHP issues (SOLVED)

One of the web pages I have been working with uses php. So I set up apache + php + mysql on my arch laptop so I could check how it looks when I am working on it.

Problem is when I call index.php in any web browser I get all the relevant html as far as the background and links but the php code just shows as plain text on the screen. It works fine on the server that houses the web page. I also had this problem with slackware, but I only ran slackware for a week or two before I found arch.

Any help would be great.

Last edited by cu3edweb (2007-10-13 02:42:11)

Offline

#2 2007-10-12 13:07:10

mrunion
Member
From: Jonesborough, TN
Registered: 2007-01-26
Posts: 1,938
Website

Re: PHP issues (SOLVED)

You must enable the php5 module in apache.  Look at the httpd.conf....


Matt

"It is very difficult to educate the educated."

Offline

#3 2007-10-12 13:10:24

cu3edweb
Member
From: USA
Registered: 2007-10-07
Posts: 291

Re: PHP issues (SOLVED)

I do have this uncommented

LoadModule php5_module             modules/libphp5.so

How can I check if it is being loaded?

Last edited by cu3edweb (2007-10-12 13:10:54)

Offline

#4 2007-10-13 02:44:51

cu3edweb
Member
From: USA
Registered: 2007-10-07
Posts: 291

Re: PHP issues (SOLVED)

Just in case someone else needs this. I found out that the php pages weren't written correctly. I didn't write them but they were using short tags

<?

Instead of

<?php

so instead of turning short tags on in the php.ini file I fixed all the tags and all is well.

Offline

#5 2007-10-17 13:01:04

Slikkie
Member
Registered: 2007-10-11
Posts: 17
Website

Re: PHP issues (SOLVED)

I switched from Debian to Arch linux. On debian I had an Apache server with PHP5 running to test the website's I am developing. On Debian the shortened

<?

instead of

<?php

was configured to work. Now on Arch linux it don't work. Can anyone tell me how to enable this? I don't want to rewrite my whole website tongue

Offline

#6 2007-10-17 16:29:59

[vEX]
Member
From: Sweden
Registered: 2006-11-23
Posts: 450

Re: PHP issues (SOLVED)

Check your php.ini file:

$ cat /etc/php/php.ini|grep short
; - short_open_tag = Off           [Portability]
;     Using short tags is discouraged when developing code meant for redistribution
;     since short tags may not be supported on the target server.
; NOTE: Using short tags should be avoided when developing applications or
; servers which are not under your control, because short tags may not
; be sure not to use short tags.
short_open_tag = Off

Though I'd recommend using <?php, you could try and using something like sed to fix all the files, perhaps something like 'sed "s|^<?|^<?php" -i *.php' though I'm no sed expert so I'm not sure if that command works. Try it at your own risk (make backups first).

Last edited by [vEX] (2007-10-17 16:31:21)


PC: Antec P182B | Asus P8Z77-V PRO | Intel i5 3570k | 16GB DDR3 | GeForce 450GTS | 4TB HDD | Pioneer BDR-207D | Asus Xonar DX | Altec Lansing CS21 | Eizo EV2736W-BK | Arch Linux x86_64
HTPC: Antec NSK2480 | ASUS M3A78-EM (AMD 780G) | AMD Athlon X3 425 | 8GB DDR2 | GeForce G210 | 2TB HDD | Arch Linux x86_64
Server: Raspberry Pi (model B) | 512MB RAM | 750GB HDD | Arch Linux ARM

Offline

#7 2007-10-17 20:53:50

Slikkie
Member
Registered: 2007-10-11
Posts: 17
Website

Re: PHP issues (SOLVED)

Yeah I found it thank you.

Offline

Board footer

Powered by FluxBB