Forum Moderators: coopster

Message Too Old, No Replies

main()

what is it exactly?

         

dreamcatcher

12:43 pm on May 31, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member


My web pages are showing errors to the effect of:

main(): stream does not support seeking in /home/blah/blah.php on line 11

I`ve contacted my hosting company to see if they can sort it out. But I`m curious, what causes an error like this?

Thanks.

:)

ShawnR

3:04 pm on May 31, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



main() is the main 'entry point' function for a C or C++ program. In this case the program is the php server. So I think it is telling you that the php server encountered a problem on line 11 of /home/blah/blah.php. What is on or around line 11 of your php file? There is probably some syntax of symantic error. Even so, php should mention the php function which caused the error rather than main(), so once you have figured out which php function caused it, you can report it here [php.net...]
and it will be fixed

(i.e. The error handling will be fixed so that it tells you which function caused the error. The error itself is something you need to fix, as it is probably a bug in your php code.

Shawn

dreamcatcher

5:47 pm on May 31, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks for the info. I don`t think the error is with the code as my site has been fine for ages. Some of my databases are now inaccessible too, so its some problem with the server I`m on.

The error messages all point to include files inside the index file. Now all the files are displaying ok, but with this error message underneath.

I`m waiting to see what my web hosting company come up with.

:)

jatar_k

6:00 pm on May 31, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Have you taken a look at a phpinfo [php.net] to see if that gives you any extra info? Maybe they updated php and it messed everything up.

dreamcatcher

10:43 pm on May 31, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member


I was thinking the same thing jatar_k. I`ve run a file with phpinfo() and got the information. Seems the system is now running PHP 4.3.2, so I guess that means its been upgraded?

I`ve got all the information, but I wouldn`t really know where to look for errors.

:)

jatar_k

11:04 pm on May 31, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



that version is the most recent
PHP 4.3.2 released [webmasterworld.com]

I would think it was a config issue. Do you have any idea what version you were running before? What is the mysterious line 11 that seems to be giving you the error?

dreamcatcher

11:21 pm on May 31, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



oh its not just line 11, its above every include file. I coded a template for my site that includes several files, ie, menus, header, footer etc. The error message appears above every file, on some 600 pages. Now, the PHP guestbook I use uses include files and shows no errors, nor does the e-card system.

My forum can`t be accessed because of a database error. My other 4 databases are fine. Everything was fine up to Thursday evening, then weird things started happening. I assume they must have upgraded sometime during that time.

My server was running PHP 4.2.3 before.

In the phpinfo file it says BUILD DATE: 29 May, so guess it was Thursday when it got screwed up

jatar_k

11:43 pm on May 31, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



as far as the db errors go, do you use an include to get at the connect info like user/pass? It could not connect if it can't include that info.

dreamcatcher

11:54 pm on May 31, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



as far as the db errors go, do you use an include to get at the connect info like user/pass? It could not connect if it can't include that info.

The exact error with the database for my forum is as follows:

mySQL query error: DELETE FROM ibf_sessions WHERE running_time < 1054421477 or member_id='1'

mySQL error: Can't open file: 'ibf_sessions.MYI'. (errno: 145)
mySQL error code: 1016
Date: Saturday 31st of May 2003 07:51:17 PM

The include files are working on my site, its just that directly above everything, say the header graphic, theres this crazy main() stream error link.

Can I send you a link via sticky mail? Thats only if you`re curious.

:)

jatar_k

12:26 am on Jun 1, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



this also might be something to look into

perror, Explaining Error Codes [mysql.com]

jatar_k

12:41 am on Jun 1, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



are you using http includes? I found a few references to them causing the problems.

Try pasting the error message in quotes into google groups. Always a great way to search for error messages. In the regular search you just get to see how many people have the error on the public page.;)

dreamcatcher

7:52 am on Jun 1, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, I am doing http includes. Maybe thats the problem. Ok, thanks for all the help. I`ll do a search, see what comes up.

:)

jatar_k

7:54 am on Jun 1, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



change them to filesystem includes if they are hosted on your site.

include "/home/site/path/page.html";
or
include $_SERVER['DOCUMENT_ROOT'] . "/include/page.html";

dreamcatcher

8:55 am on Jun 1, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks. I`ve tried it and it works. Excellent. At least thats one problem I now know the answer too.

Thanks for all your help and patience jatar_k, I really appreciate it.

:)