473,468 Members | 1,437 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

parse errors being surpressed

I have two servers that have had PHP installed on them and...

<?php
echo 'hello, world!
?>

....displays a parse error on server A and doesn't display anything on
server B.

Any ideas as to what the problem is?

Jul 10 '06 #1
10 1616

yawnmoth wrote:
I have two servers that have had PHP installed on them and...

<?php
echo 'hello, world!
?>

...displays a parse error on server A and doesn't display anything on
server B.

Any ideas as to what the problem is?
yes, you need have the echo line ending with a colon like so:

echo "Sup world??";

why does it work on one server and not the other.. well not sure off
the top of my head but will be soemthing in the php.ini config. Do a
phpinfo(); on each machine to compare.

Flamer.

Jul 10 '06 #2
Rik
yawnmoth wrote:
I have two servers that have had PHP installed on them and...

<?php
echo 'hello, world!
>>
<?php
echo 'hello, world!';
?>
...displays a parse error on server A and doesn't display anything on
server B.
Run:
<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);
echo 'hello, world!
?>

Grtz,
--
Rik Wasmus
Jul 10 '06 #3

yawnmoth wrote:
I have two servers that have had PHP installed on them and...

<?php
echo 'hello, world!
?>

...displays a parse error on server A and doesn't display anything on
server B.

Any ideas as to what the problem is?
Oh sorry, just read your question, thought you meant it worked on one
and not the other now I see it doesnt work on either, yes it wont, use
code as above, one php is set to output error to screen, the other, you
will probably find a file in the dir the script is in called error.log
and that will contain the error message there (which is a better option
for production servers).

Flamer.

Jul 10 '06 #4

Rik wrote:
yawnmoth wrote:
<snip>

Run:
<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);
echo 'hello, world!
?>
That doesn't seem to help with parse errors (as evidenced by the fact
that that script displays nothing, as well), but it did get me thinking
that maybe I could try setting it in the .htaccess file.
Unfortunately, it'd appear that I can't create .htaccess files on this
server. I also tried dropping a php.ini file there with
display_errors=1 but that didn't help...

Jul 10 '06 #5

flamer di******@hotmail.com wrote:
yawnmoth wrote:
I have two servers that have had PHP installed on them and...

<?php
echo 'hello, world!
?>

...displays a parse error on server A and doesn't display anything on
server B.

Any ideas as to what the problem is?

Oh sorry, just read your question, thought you meant it worked on one
and not the other now I see it doesnt work on either, yes it wont, use
code as above, one php is set to output error to screen, the other, you
will probably find a file in the dir the script is in called error.log
and that will contain the error message there (which is a better option
for production servers).

Flamer.
Errors are also logged to the apache log file, usually someplace in
/var/log. if you're on a shared host or something, they usually
provide a symlink or something to the logging directory.

Jul 10 '06 #6
As several others have noted, your code has errors in it.

This code is giving parse errors because you are missing a quotation
mark ( ' ) and a semi-colon to end the statement.

<?php
echo 'hello, world!
?>

as posted by others try this instead:

<?php
echo 'hello, world!';
?>

As for the errors messages, check each server's php.ini and see what
level of error reporting each is setup for.

Jul 10 '06 #7

william.clarke wrote:
As several others have noted, your code has errors in it.

This code is giving parse errors because you are missing a quotation
mark ( ' ) and a semi-colon to end the statement.

<?php
echo 'hello, world!
?>

as posted by others try this instead:

<?php
echo 'hello, world!';
?>
When you're _trying_ to get parse errors, using syntactically correct
code isn't such a great idea ;)

Jul 11 '06 #8

yawnmoth wrote:
william.clarke wrote:
As several others have noted, your code has errors in it.

This code is giving parse errors because you are missing a quotation
mark ( ' ) and a semi-colon to end the statement.

<?php
echo 'hello, world!
?>

as posted by others try this instead:

<?php
echo 'hello, world!';
?>
When you're _trying_ to get parse errors, using syntactically correct
code isn't such a great idea ;)
Ah, I see. I don't habitually try to get parse errors...silly me, these
new trends in coding make me feel so old.

Jul 11 '06 #9

william.clarke wrote:
yawnmoth wrote:
<snip>
When you're _trying_ to get parse errors, using syntactically correct
code isn't such a great idea ;)

Ah, I see. I don't habitually try to get parse errors...silly me, these
new trends in coding make me feel so old.
If you're currious as to why I was trying to do this... I
recreationally write modifications to open source projects in PHP.
Someone had applied the changes that one of my modifications required
but found their site not to be working after the changes were made.
The problem, as it turned out, was that they replaced a } with a ), but
since their website didn't display syntax errors, it took me more time
to figure it out than it might have otherwise taken me.

Call it a new trend if you like. I wouldn't.

Jul 12 '06 #10
yawnmoth wrote:
If you're currious as to why I was trying to do this... I
recreationally write modifications to open source projects in PHP.
Someone had applied the changes that one of my modifications required
but found their site not to be working after the changes were made.
The problem, as it turned out, was that they replaced a } with a ), but
since their website didn't display syntax errors, it took me more time
to figure it out than it might have otherwise taken me.
Ah, that makes sense, because I was thinking "why would code with parse
errors ever leave your development environment?", but now I can see how
it would happen :) That sort of thing occasionally happens where I
work too, but the fact totally broken code gets released still
surprises me. I hope you've managed to sort out all the newly
introduced parse errors now.

Jul 12 '06 #11

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

Similar topics

2
by: Dave O'Hearn | last post by:
This is a stripped down example that duplicates the problem I am having. If I do it with concrete types, I can access the set's iterator type correctly. If I make a template with generic types, I...
23
by: Charles Law | last post by:
Does anyone have a regex pattern to parse HTML from a stream? I have a well structured file, where each line is of the form <sometag someattribute='attr'>text</sometag> for example <SPAN...
8
by: Spartanicus | last post by:
The document at http://homepage.ntlworld.com/spartanicus/custom_dtd.htm uses a custom DTD, the w3c validator validates it but with this warning: "Unknown Parse Mode! The MIME Media Type...
2
by: Vittal | last post by:
Hello All, I am trying to compile my application on Red Hat Linux 8 against gcc 3.2.2. Very first file in application is failing to compile. I tried compiling my application on Linux 7.2...
5
by: tony collier | last post by:
I have ..... enum day {monday, tuesday, wednesday}; myArray=5; i=(int)Enum.Parse(typeof(day), wednesday);
21
by: BWIGLEY | last post by:
Basically I've just started making a game. So far it makes an array 25 by 20 and tries to make five rooms within it. In scr_make_room() there's parse errors: 20 C:\c\Rooms\Untitled1.c parse error...
13
by: Gilles Ganault | last post by:
Hello Is there a tool on Linux/FreeBSD that can parse a PHP script to make sure there's no compile-time issues? I just noticed that I copy/pasted some code that had lines longer that can fit...
4
by: Damodhar | last post by:
Any one help me to parse the bellow xml feed please .. =========================================================== <item> <title>Green earthquake alert Japan(M=6.8) potentially affecting 4.6...
3
by: broll911 | last post by:
I am gettin a error message on this script can someone help me. I am a complete newbie on this stuff. Thanks in advance for any help you can give me. here is the error. Parse error: syntax error,...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.