473,324 Members | 2,456 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

PHP parser error only on production box

Hi

Here is my code snippet:

<?php
error_reporting(E_ERROR | E_PARSE);
?>
<html>
<body>
<form action = "<?php$_SERVER['php_self']?>" method = "GET" >
<?php
echo "adasd";
?>
</form>
</body>
</html>
if you see form action of the above lines, semicolon wont be there and
also the word 'echo'. If i execute this, it supposed to throw an
parser error and script should get terminated at that point.

It is happening in my production/staging environment but it not the
case in development server.

So I compared the error_reporting, display_html_errors, etc values of
both the environments and it is same interms of error level mechanism.
Is there any constants in php.ini which tells php interpreter not able
to produce parse error in my development server?

Thx in advance

Jun 20 '07 #1
4 1907
Mani wrote:
<form action = "<?php$_SERVER['php_self']?>" method = "GET" >
This will just throw a notice because the $_SERVER array doesn't contain a
php_self key (only a PHP_SELF key). The semicolon is not mandatory in this
case, because of the closing tag and the absence of trailing code. Not using
echo or print, won't trigger alarms either...
JW
Jun 20 '07 #2
On Jun 21, 1:57 am, "Janwillem Borleffs" <j...@jwscripts.comwrote:
Mani wrote:
<form action = "<?php$_SERVER['php_self']?>" method = "GET" >

This will just throw a notice because the $_SERVER array doesn't contain a
php_self key (only a PHP_SELF key). The semicolon is not mandatory in this
case, because of the closing tag and the absence of trailing code. Not using
echo or print, won't trigger alarms either...

JW

I changed the key from php_self to PHP_SELF and executed the script in
both environments. Like earlier, production box is throwing

PHP Parse error: syntax error, unexpected T_VARIABLE in SCRIPTPATH on
line 6

and script execution is getting terminated whereas in local
development environment, it is not throwing any error and notices.

Following are the details of both environments.
Local environment:

1. SUSE LINUX 10.0 (i586)
2. PHP 5.2.1 with Suhosin-Patch 0.9.6.2 (cli) (built: Apr 4 2007
07:31:59)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies

php.ini error constants:

error_reporting = E_ALL
display_errors = Off
;html_errors = Off

Production environment:

1. SUSE LINUX 10.0 (i586)
2. PHP 5.2.1 with Suhosin-Patch 0.9.6.2 (cli) (built: Apr 4 2007
07:31:59)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
with Suhosin v0.9.18, Copyright (c) 2002-2006, by Hardened-PHP
Project

php.ini error constants:

error_reporting = E_ALL
display_errors = Off
;html_errors = Off

I compared the both php.ini's and found no difference interms of error
reporting perspective.

I am just thinking, Is there any problem in php module ?

Thanks


Jun 21 '07 #3
Mani wrote:
Following are the details of both environments.
Compare outputs of php_info() function in both environments. php.ini is
one of many places where PHP settings can hide.

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.12-12mdksmp, up 10:28.]

dict, thes & ency
http://tobyinkster.co.uk/blog/2007/0...ict-thes-ency/
Jun 21 '07 #4
I got the reason behind this strange behaviour. The short_open_tag
value is "Off" in my production box, whereas it is "On" in development
environment.

Jun 26 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Paulo Pinto | last post by:
Hi, does anyone know of a Python package that is able to load XML like the XML::Simple Perl package does? For those that don't know it, this package maps the XML file to a dictionary.
2
by: Michael D Murphy | last post by:
Hi, I am getting the following error when I strart debugging, regardless of the project or solution I am working on. Any help would certainly be appreciated. Michael Server Error in...
2
by: ST | last post by:
Hi, I keep getting the parser error, and I have no idea why. I've tried a number of things including: 1)building/rebuilding about 100x 2)making sure all dll's are in the bin folder in the root...
1
by: Kenneth | last post by:
Hi, I have an asp.net app (testShow.aspx) with a code behind file (testShow.aspx.vb) I run on my .NET 2002 dev machine and it works alright on the localhost, but when I copy the testShow.aspx...
0
by: PeterB | last post by:
I get error 'Parser Error Message: Access is denied ...' in my webapplication 1. indexing service on server and dev. PC is off 2. error appearing randomly 3. error appearing both in development...
6
by: ST | last post by:
Hi, I keep getting the parser error, and I have no idea why. I've tried a number of things including: 1)building/rebuilding about 100x 2)making sure all dll's are in the bin folder in the root...
4
by: ChrisFrohlich | last post by:
I am trying to deploy two copies of an application to a single website using two virtual directories: "2007" (Production) and "Demo". Each of these applications should point at a different DB, so...
28
by: Neo Geshel | last post by:
NOTE: PAST EXPERIENCE HAS SHOWN ME THAT MANY ON USENET FAIL TO READ ARTICLES PROPERLY PRIOR TO ANSWERING. I AM LOOKING FOR VERY SPECIFIC INFORMATION, THEREFORE PLEASE READ AND UNDERSTAND...
6
by: Bobby Edward | last post by:
Using ASP.NET 3.5 and MySQL (thru DevArt MyDirect.NET)... On the production server I get a "Parser Error" for every XSD dataset. It works perfect on my dev machine. But, on the production...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.