473,396 Members | 2,108 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.

Script Dying At include()

I tried to run a simple script today on my PC (WinXP, PHP5, MySQL
4.0.17) that I haven't run for about a year, and for some reason it's
dying at an include() statement that used to work fine. I double
checked to make sure the file is still there, and it is. The weird
thing is, I'm not getting any type of error to tell me what the problem
is. I tried

include(file.php) or die (mysql_error());

but still got no error. I've had some other issues since I went to
PHP5, so I tried going back to 4.3.9, but I still have the same problem.
The exact same setup on my laptop works just fine, so I know it's
something local to the PC. Can anyone give me a suggestion as to why my
script would be dying at include()?

Thanks

Steve
Jul 17 '05 #1
4 1580
.oO(Steve)
include(file.php) or die (mysql_error());
You can't use an include like that. include/require are no functions,
they are special language constructs. Have a look at the manual for some
more details on how these constructs work and why the above can't work
as expected.

http://www.php.net/include
but still got no error.


Set error_reporting to E_ALL in your php.ini.

In an example like above I get a warning and the file is not included.

Micha
Jul 17 '05 #2
Put:

ini_set('display_errors','1');
error_reporting(E_ALL);

at the top of your script to debug this.

Jul 17 '05 #3
Maybe use something like the script below, just to verify if its looking in
the correct place.

if file_exists("file.php"){
include("file.php");
else {
echo "<br> File not found<br>";
}
"Jasper Bryant-Greene" <ja******@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Put:

ini_set('display_errors','1');
error_reporting(E_ALL);

at the top of your script to debug this.

Jul 17 '05 #4
"Jasper Bryant-Greene" <ja******@gmail.com> wrote in message news:<11**********************@f14g2000cwb.googleg roups.com>...
Put:

ini_set('display_errors','1');
error_reporting(E_ALL);


or even better error_reporting(E_ALL | E_STRICT);

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com
Jul 17 '05 #5

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

Similar topics

2
by: Bob | last post by:
Hi, I'm trying to build a PHP page which launches another php script to be run in the background. The web page should return immediately, while the background script may run for 10 minutes or...
7
by: Arun | last post by:
Hi, This is a scripting question, but since I am writing the script in python I am posting this question here: I have a python script that runs a simulator (that was written in c++, so I use...
6
by: Justice | last post by:
Just moved site to different web server. Previously no problems. Now, the script will time out after 90 minutes. I've set set_time_limit(0) but no effect. Any ideas? John
17
by: comp.lang.tcl | last post by:
The TCL command I am using will do a command-line action on a PHP script: set cannotRunPHP I have to do it this way as both the TCL script and the PHP script run as CLI. However, "info.php"...
22
by: zee | last post by:
Hi, I remember when i first went to school and got my copy of "oh Pascal" and thought it was a great language. What seemed like a lifetime later. It was then C closely followed by C++ as I...
44
by: rhythmace | last post by:
W3C HTML validator passes this: .... <script type="text/javascript" src="foo.js"> <script type="text/javascript"> ....script in here... </script> ....
18
by: Linny | last post by:
Hi, Came across this article in the ComputerWorld website which has included C in the top ten dying languages. The top 10 dead (or dying) computer skills...
1
by: nkjp | last post by:
Hi I've found that my script to start sybase isn't working at all. Infact, with some debugging, I've found that it's dying here at the first variable defenition (I found this by logging messages...
3
by: GazK | last post by:
I have been using an xml parsing script to parse a number of rss feeds and return relevant results to a database. The script has worked well for a couple of years, despite having very crude...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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,...
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.