LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-17-2005, 09:03 AM   #1
rblampain
Senior Member
 
Registered: Aug 2004
Location: Western Australia
Distribution: Debian 11
Posts: 1,288

Rep: Reputation: 52
PHP4 executes some & displays others


Distro Sarge 3.1 Kernel 2.6.13

I am trying to have Apache2, MySQL and PHP4 working together, so far they are working independently but I am hitting a strange problem with PHP, I have downloaded into /var/www/tiki/ some php scripts that are necessary to install a CMS program "tikiwiki", the complete install is done with PHP scripts but PHP4 refuses to execute any of these scripts, displaying the contents instead. However PHP4 executes correctly another php script I have put in the same /var/www/tiki/ directory.

I have no idea what the problem could be. What should I be looking for?
All these scripts start with <? and end with ?>. They recommend PHP4.1+ and I have PHP4.4.x.
Permissions are the same for the scripts that are executed than the scripts displayed from the same directory.

Thank you for your help.

Last edited by rblampain; 12-17-2005 at 09:05 AM.
 
Old 12-17-2005, 02:10 PM   #2
Thinking
Member
 
Registered: Oct 2003
Posts: 249

Rep: Reputation: 30
i had something similar on a windows box
but my problem was that IE displayed the php script correctly and firefox wanted to download the script

the problem was that i configured apache wrong
tried firefox --> firefox wanted to download script, because apache was wrong configured
after some configuration stuff apache runs correctly and firefox wanted to download the file
then i tried IE and it worked
but apache wanted to download

the problem was that firefox cached the website, so it wanted to dl it every time
clearing the firefox cache solved my problem
 
Old 12-17-2005, 09:15 PM   #3
rblampain
Senior Member
 
Registered: Aug 2004
Location: Western Australia
Distribution: Debian 11
Posts: 1,288

Original Poster
Rep: Reputation: 52
Thank you for the tip but the same procedure is used in both cases from the CLI:

rene@lt:/var/www/tiki$ php < mytest.php
is executed correctly

rene@lt:/var/www/tiki$ php < tiki-install.php
displays the contents of the script

running the scripts as root makes no difference.

Last edited by rblampain; 12-17-2005 at 09:51 PM.
 
Old 12-17-2005, 09:54 PM   #4
rblampain
Senior Member
 
Registered: Aug 2004
Location: Western Australia
Distribution: Debian 11
Posts: 1,288

Original Poster
Rep: Reputation: 52
I've just found that running the following command executes the script correctly:
rene@lt:~$ php < /var/www/tiki/tiki-install.php
but
rene@lt:/var/www/tiki$ php < tiki-install.php
still only displays the contents of the script
 
Old 12-17-2005, 09:59 PM   #5
rblampain
Senior Member
 
Registered: Aug 2004
Location: Western Australia
Distribution: Debian 11
Posts: 1,288

Original Poster
Rep: Reputation: 52
I've just found running the following command executes the script correctly:
rene@lt:~$ php < /var/www/tiki/tiki-install.php

but running the script as described above still only displays the contents.

Any comments welcome.
 
Old 12-17-2005, 10:59 PM   #6
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
A couple of suggestions:

1. Try different PHP command line options (to either work around the problem, or
identify the problem so that you can correct it)

EXAMPLES:
php -f badscript.php
php -r badscript.php
php -l badscript.php

2. Please cut/paste the first couple of lines of one of the offending scripts;
perhaps that might help identify the problem.

Your .. PSM
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP3 & PHP4 Differences? oberon-ken-obi Programming 3 04-01-2005 01:12 PM
SElinux & php4 & interbase & apache maxut Linux - Security 0 03-15-2005 04:57 AM
How do I configure php4 & apachee 1.3? walterbyrd Debian 10 08-22-2004 07:34 PM
apache && php4 err DaFrEQ Linux - Software 0 01-17-2003 03:39 PM
Apache2 & php4 CyberDrake Linux - Newbie 2 11-25-2002 11:32 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration