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?
9 1821
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 '}'.
can we see your code?
usually this is caused by forgetting a '}'
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.
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.
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?
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?
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
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.
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
Sign in to post your reply or Sign up for a free account.
Similar topics
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 ,...
|
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...
|
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
...
|
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...
|
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....
|
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...
|
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...
|
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...
|
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...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
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,...
|
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...
|
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,...
| |