PHP 4 -> 5 problem.
Moderator: General Moderators
PHP 4 -> 5 problem.
Hi, i have a problem while changing PHP 4 code to work on PHP 5.
If anyone is willing to help me out a bit please add me to msn. file[dot]syntax[at]hotmail[dot]com
Thanks.
If anyone is willing to help me out a bit please add me to msn. file[dot]syntax[at]hotmail[dot]com
Thanks.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: PHP 4 -> 5 problem.
This is not what our web forum is for. I'm also not convinced you'll get much help by asking people to MSN you in order to help you. Please post your problem here so others can help you and so that (possibly) in future others can be helped by reading your problem with its solution.
Re: PHP 4 -> 5 problem.
Ok sorry.
in php 5 get_class has to be changed to strtolower(get_class($str))
but after i do the change one of the files gives me an error because of a function. (first line of it)
in php 5 get_class has to be changed to strtolower(get_class($str))
but after i do the change one of the files gives me an error because of a function. (first line of it)
Code: Select all
function BreakString($strText, $intMaxLength, $strSuffix = "") {- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: PHP 4 -> 5 problem.
What is the error it gives you?Disent wrote:Ok sorry.
in php 5 get_class has to be changed to strtolower(get_class($str))
but after i do the change one of the files gives me an error because of a function. (first line of it)
Code: Select all
function BreakString($strText, $intMaxLength, $strSuffix = "") {
Re: PHP 4 -> 5 problem.
It gives me a an error that actually points to a different file but im pretty sure the error is there because i traced.
anyway this is what the error referes to:
foreach ($engSystem->arrStructure[INTERFACE_NAME][$engUser->fnGetParam("level")] AS $tmpKey => $tmpItem) {
"level" seems to be empty...
Warning: Invalid argument supplied for foreach() in index.php on line 30
anyway this is what the error referes to:
foreach ($engSystem->arrStructure[INTERFACE_NAME][$engUser->fnGetParam("level")] AS $tmpKey => $tmpItem) {
"level" seems to be empty...
Warning: Invalid argument supplied for foreach() in index.php on line 30
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: PHP 4 -> 5 problem.
I'm really sorry but you're talking in riddles
Could you please elaborate on the exact nature of your problem? Posting these tiny little excerpts of code is telling me nothing at all since I have no idea what that code is supposed to do and/or what's not working. If you're getting an error message please post the exact error message here. if you're not getting an error but something isn't working, please start from the beginning, explaining what *should* be happening, but describing what *is* happening. Also post as much code as you think is relevant... not just these partial lines.
You need to help us understand your problem before we can help you
You need to help us understand your problem before we can help you
Re: PHP 4 -> 5 problem.
It's a whole costum CMS system.
My assignment today is to change a clients PHP 4 version to PHP 5.
I searched get_class i all the files and replaced them all with strtolower get_class and replaced the old files. Now if i replace general.inc it gives me the error but if i keep the old general.inc it works on php 4 atleast. So thats how i know the error is there. I tested the code on php 5 too but it gives me the same error and even more. For some reason its pointing to index.php but that works fine with the old general.inc.
I used exit; to find the line where it breaks. and that points to the line i gave you(the functions first line).
What that function is supposed to do is to check if the strText is longer than max allowed(for formating reasons).
This function i runned everytime i load the page.
My assignment today is to change a clients PHP 4 version to PHP 5.
I searched get_class i all the files and replaced them all with strtolower get_class and replaced the old files. Now if i replace general.inc it gives me the error but if i keep the old general.inc it works on php 4 atleast. So thats how i know the error is there. I tested the code on php 5 too but it gives me the same error and even more. For some reason its pointing to index.php but that works fine with the old general.inc.
I used exit; to find the line where it breaks. and that points to the line i gave you(the functions first line).
What that function is supposed to do is to check if the strText is longer than max allowed(for formating reasons).
This function i runned everytime i load the page.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: PHP 4 -> 5 problem.
What error?
j/k
Seriously though, we need to know the error.
j/k
Re: PHP 4 -> 5 problem.
check my posts. I already showed you the error. I edited both my posts i think.
Re: PHP 4 -> 5 problem.
Sorry, but I can't find the error you state you post either, just small lumps of code..
You have a problem with:
...giving you...
It's just not enough to assist with. For me.
You have a problem with:
Code: Select all
foreach ($engSystem->arrStructure[INTERFACE_NAME][$engUser->fnGetParam("level")] AS $tmpKey => $tmpItem) {...but you also state that the problem lies within here...Warning: Invalid argument supplied for foreach() in index.php on line 30
Code: Select all
function BreakString($strText, $intMaxLength, $strSuffix = "") {Re: PHP 4 -> 5 problem.
Thats why i wanted to get someone on msn. I don't want to post alot of code on the internet when its not mine.
Re: PHP 4 -> 5 problem.
After i change the servers settings to run on PHP 5. I get this:
Warning: session_start() [function.session-start]: open(/var/tmp/sess_86c7d68856073d8a17c4ac47219fc5e4, O_RDWR) failed: Permission denied (13) in /htdocs/init/public.inc on line 5
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /htdocs/init/public.inc:5) in htdocs/init/public.inc on line 5
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /htdocs/init/public.inc:5) in /htdocs/init/public.inc on line 5
Warning: Cannot modify header information - headers already sent by (output started at /htdocs/init/public.inc:5) in /htdocs/init/public.inc on line 34
Internal Server Error
.......which says htacces file uses restricted directives and the PHP script takes too much resources... change the memory limit (memory_limit).
Not sure if i got this all right in english.
Warning: session_start() [function.session-start]: open(/var/tmp/sess_86c7d68856073d8a17c4ac47219fc5e4, O_RDWR) failed: Permission denied (13) in /htdocs/init/public.inc on line 5
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /htdocs/init/public.inc:5) in htdocs/init/public.inc on line 5
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /htdocs/init/public.inc:5) in /htdocs/init/public.inc on line 5
Warning: Cannot modify header information - headers already sent by (output started at /htdocs/init/public.inc:5) in /htdocs/init/public.inc on line 34
Internal Server Error
.......which says htacces file uses restricted directives and the PHP script takes too much resources... change the memory limit (memory_limit).
Not sure if i got this all right in english.
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: PHP 4 -> 5 problem.
It looks like the webserver does not have permission to write to '/var/tmp/'. It may not exist or have the wrong permissions. Create it, change the permissions, or change it php.ini to '/tmp'.
(#10850)