can't initialize more variables

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
djot
Forum Contributor
Posts: 313
Joined: Wed Jan 14, 2004 10:21 am
Location: planet earth
Contact:

can't initialize more variables

Post by djot »

-
Hi,

I tried to initialize $test. For testing purposes I did embed it into test output, because I could not initialize more variables for some reason I don't know.

Besides:
The original script did set many variables already. But I am far away of exhausting memory limits. When trying to set another variable, I get an internal server error. No matter which line below the current line I try to set a variable of any type or any value, I get this error.

Code: Select all

echo "1";
$test="hello world.";
echo "2";
output is

Code: Select all

1
and then the script crashes.


djot
-
Last edited by djot on Mon Dec 12, 2005 11:34 am, edited 1 time in total.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Restart your web server or re-install if that doesn't work. If you're seriously saying that simply assigning a value to $test is crashing the server you may have some corrupt install of PHP... more than likely an httpd daemon restart will suffice though.
djot
Forum Contributor
Posts: 313
Joined: Wed Jan 14, 2004 10:21 am
Location: planet earth
Contact:

Post by djot »

-
Well thx, it is a webserver of a big <span style='color:blue' title='I&#39;m naughty, are you naughty?'>smurf</span> isp company. The script runs on lots of other servers of other isps. Did not here such problems from other persons. Restarting is impossible, at least on a legal way :)

Any other ideas?

djot
-
vincenzobar
Forum Commoner
Posts: 95
Joined: Wed Nov 02, 2005 9:57 am

Post by vincenzobar »

remove the " before the first echo!!!
djot
Forum Contributor
Posts: 313
Joined: Wed Jan 14, 2004 10:21 am
Location: planet earth
Contact:

Post by djot »

-
Yes thanks, but this error was only here in the forum example code, the problem is still the same. Forum code corrected.

djot
-
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Have you got a dodgey .htaccess file in the directory or such like? That could also be the cause.
djot
Forum Contributor
Posts: 313
Joined: Wed Jan 14, 2004 10:21 am
Location: planet earth
Contact:

Post by djot »

-
Well, I have the same .htaccess file in some data folders, but not in the one with the file where the error occurs.

Code: Select all

order deny,allow
deny from all
If you were right, the script would break when trying to include a file. In my case it breaks in the middle of a php file (line 46) when trying to set a variable to $test=ARRAY(); (or whatever).

I could not find any variable restrictions in php.ini that might cause this error. Also I can't imagine of memory limit, cause the script is far below the limit. I thought of limited access of calling files per session also, but that also would not explain, while the file breaks in the middle of the code and not before (or while loading).

djot
-
Post Reply