LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-27-2007, 12:08 AM   #1
Splenden
Member
 
Registered: Jan 2007
Posts: 32

Rep: Reputation: 15
PHP: some scripts parse, some don't (HTTP and CLI)


Hi all,

I have a problem with PHP. Some scripts are parsing, while some scripts are not. This is via the CLI and via Apache. For example, phpinfo() parses, but a script I'm trying to use, which works on a shared hosting account I have, does not work.

I am using PHP 5.2.1 on Ubuntu 6.06 minimal. It is in a chroot jail along with Apache.

Thank you,

Splenden
 
Old 03-27-2007, 12:20 AM   #2
Zention
Member
 
Registered: Mar 2007
Posts: 119

Rep: Reputation: 16
Well the chroot is probably the culprit - a chroot limits access on a system once you are chroot'd in.

Find a small example of something that works phpinfo() is ok for that - and then one that does not work.

To make the one that does not work small start by deleting some of the commands or the includes until it suddenly starts to work.

Now the deletion prior to it working is an example of code that is not working.

Have a look around the chroot and see if you have the tools installed to allow that command to work if not then that is the problem.

If you do, then it is not being related to those tools (perms have to right still in the chroot).
 
Old 03-27-2007, 12:24 AM   #3
Splenden
Member
 
Registered: Jan 2007
Posts: 32

Original Poster
Rep: Reputation: 15
Hi,

Thank you for the help.

phpinfo does work, but I am unable to post the script in question that doesn't work, since it's a script I do not have the rights to post (it's a paid script). But I will try that and see if it helps.

Also, CLI is being done outside of the jail, so it's not a permission issue I don't think.

Thank you,

Splenden
 
Old 03-27-2007, 12:26 AM   #4
Splenden
Member
 
Registered: Jan 2007
Posts: 32

Original Poster
Rep: Reputation: 15
That was like... instant. Found the culprit

Code:
require_once($(dir variable)."/somescript.php");
include_once("somescript.inc");
I have changed the file names since I'm not allowed to post its actual source.

Do you have any ideas on how I could fix that, since it's required to open the script (the includes are)?

Thank you,

Splenden
 
Old 03-27-2007, 01:02 AM   #5
Zention
Member
 
Registered: Mar 2007
Posts: 119

Rep: Reputation: 16
hmm what does echo $(dir variable) give?
 
Old 03-27-2007, 01:11 AM   #6
Splenden
Member
 
Registered: Jan 2007
Posts: 32

Original Poster
Rep: Reputation: 15
Right now it just prints the source code for some reason, even after commenting out those lines. I downgraded to PHP 4.4.6 (latest version), so it's not a matter of the version being PHP 5.

It looks like a software issue, in which case I'll contact support for the software and see what's going on/

Thank you,

Splenden
 
Old 03-27-2007, 01:27 AM   #7
Splenden
Member
 
Registered: Jan 2007
Posts: 32

Original Poster
Rep: Reputation: 15
I should have included this in my last post.

Here is what the directory thing is:

dirname(__FILE__)

(I should be okay giving that out - after all, it's a generic PHP function and gives no information as to the product code)
 
  


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
What's the meaning of "PHP Parse error: parse error, unexpected $ in..." frandalla Programming 23 03-04-2009 12:34 PM
Parse HTML using PHP jilljack Programming 1 11-07-2005 09:46 AM
PHP parse error in config.inc.php.in Confusedious Linux - Software 2 11-03-2005 05:08 AM
Parse PHP, not open!! mattp Programming 2 10-10-2005 12:09 AM
My Apache2 fails to parse php-scripts in html pages 3-1415 Linux - Software 6 10-21-2004 05:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:19 PM.

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