473,396 Members | 2,085 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,396 software developers and data experts.

error message: unexpected $end only when running file on Windows XP

I received the error message "unexpected $end" on a file while running the script under Windows (Apache 2); runs without error on Linux (Apache 1). Any suggestions?
Jul 25 '07 #1
9 1821
pbmods
5,821 Expert 4TB
Heya, windmill. Welcome to TSDN!

Usually, this error occurs because somewhere in your script, there is an opening curly brace '{' that is not paired with a closing curly brace '}'.
Jul 25 '07 #2
epots9
1,351 Expert 1GB
can we see your code?

usually this is caused by forgetting a '}'
Jul 25 '07 #3
Heya, windmill. Welcome to TSDN!

Usually, this error occurs because somewhere in your script, there is an opening curly brace '{' that is not paired with a closing curly brace '}'.
I've checked and re-checked the script. All braces are balanced. The odd thing is that the script runs perfectly on a Linux server, but fails on my Windows development machine.
Jul 25 '07 #4
can we see your code?

usually this is caused by forgetting a '}'

I've checked and re-checked the script. All braces are balanced. The odd thing is that the script runs perfectly on a Linux server, but fails on my Windows development machine.
Jul 25 '07 #5
pbmods
5,821 Expert 4TB
Heya, Windmill.

Is there a particular script that is causing this error, or does every page do this? If you create a new PHP file on the Windows server, does it generate this error?
Jul 25 '07 #6
Heya, Windmill.

Is there a particular script that is causing this error, or does every page do this? If you create a new PHP file on the Windows server, does it generate this error?
It is one particular script that generates the error. The file is included into another file via the require function. The file was originally created on Linux. Is there a php.ini setting to account for file creation differences between Windows and Linux?
Jul 25 '07 #7
PHPLJH
1
I too, have had a very similar issue, it happened that I had started a script using the long tag "<?PHP" ,closed that segment of PHP and then later on in the script started some more PHP code with "<?". It worked fine on the current server, however I recently moved it to a new one.

Once I had realised that it was the short tag causing the issue ('not easy!!') the problem was simple to fix I just enabled the open_short_tag directive in the php.ini file and voila... I'm not sure this will help but i thought it can't hurt.. hard to say more without knowing more about the issue.

I would be inclined to sugeest that the problem is likely with your server config and more than likely the php.ini...

Hope this helps
Lee
Jul 25 '07 #8
pbmods
5,821 Expert 4TB
You can fix short tags by using the following regular expression syntax.

Yes, I said 'fix'. PHP 6 won't support short tags.

Replace '<\?(?!php|xml|=)' with '<?php'
Replace '<\?=' with '<?php echo'

You'll need a text editor that can handle regular expression search and replace.
Jul 25 '07 #9
This error can be caused by the interaction of single and double quotes, and by windows line endings confusing heredocs expecting unix endings.

Notepad++ has a feature to change the line endings.

It also colours quoted strings in cream, not white. If your source suddenly starts to has cream background with white to its right, check for a missing, extra or unbalanced " and '.

Hope this helps.

Ian
Jul 27 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Jagdeesh | last post by:
Hai Colleagues, I am using Tomcat 4.1.24 and JDK 1.4.0_03 in my winXP machine. I've transferred a set of folders(containing jsp files) into tomcat's webapps directory(to /webapps/bob ,...
5
by: Tony Wright | last post by:
Hi, I am having a problem installing an msi for a web site. The error message I am getting is: "The specified path 'http://mipdev05/features/Fas2' is unavailable. The Internet Information...
2
by: Petar Popara | last post by:
This is from Event Viewer. What is it? Error: Script Engine Exception. A ScriptEngine threw expection 'C0000005' in 'IActiveScript::SetScriptState()' from ...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
7
by: p | last post by:
WE had a Crystal 8 WebApp using vs 2002 which we upgraded to VS2003. I also have Crystal 9 pro on my development machine. The web app runs fine on my dev machine but am having problems deploying....
4
by: Al Williams | last post by:
Hi, I have error handling in place throughout my application. I also start the application wrapped in error handling code to catch any unexpected exceptions (i.e. exceptions that occur where I...
0
by: Ahmad Atawneh | last post by:
I have the following problem: i have a client (windows service) calling a web service using an 128kbps connection line. The client will frequently send records of approximately 300KB to the web...
5
by: snicks | last post by:
I'm trying to exec a program external to my ASP.NET app using the following code. The external app is a VB.NET application. Dim sPPTOut As String sPPTOut = MDEPDirStr + sID + ".ppt" Dim p As...
1
by: Alexander Higgins | last post by:
>>Thanks for the response.... Point Taken but this is not the case. Thus, if a person writes a text file on her or his computer and does not use UNICODE to save it, the current code page is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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,...

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.