homepage Welcome to WebmasterWorld Guest from 54.197.110.151
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Undefined Variables
PHP5 on Windows 2003 (iis6)
chocoholic



 
Msg#: 4223306 posted 11:32 am on Oct 28, 2010 (gmt 0)

Hi hope someone can help...I've uploaded the thesis theme to my wordpress instalation which is sitting on windows 2003 box. I had no problems with the default wordpress theme but when i uploaded thesis i get lots of undifined variable errors. After a bit of digging i read that this can happen on windows. Can someone help me - is there a script which i can use to set all variables or do i have to tackle each one by one. Does anyone know the syntax i should use to do this or a reference point...Sorry im a dotnet developer and php is all new to me.

thanks

 

rocknbil

WebmasterWorld Senior Member rocknbil us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4223306 posted 4:09 pm on Oct 28, 2010 (gmt 0)

Are any of the include paths for the theme failing? That would be the first place I'd look. You can also enable the WP_DEBUG [codex.wordpress.org] constant which may help. Agreed, you should first try to solve the cause, not specific instances of the undefined variables.

chocoholic



 
Msg#: 4223306 posted 4:18 pm on Oct 28, 2010 (gmt 0)

i'll switch on the debuger and see what i get..thankyou for replying

penders

WebmasterWorld Senior Member penders us a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



 
Msg#: 4223306 posted 10:15 pm on Oct 28, 2010 (gmt 0)

It's certainly true that under Windows there are sometimes $_SERVER[] vars that you might expect to be defined aren't. $_SERVER['DOCUMENT_ROOT'] and $_SERVER['REQUEST_URI'] are two that sometimes cause problems. However, there are usually workarounds. They can often be derived (and set) from other vars.

...lots of undifined variable errors


Lots of the same, or lots of different vars? I'm guessing lots of the same? If it was lots of different vars then it's another problem (not necessarily a Windows problem), may be an include path is failing as rocknbil suggests.

What specific errors are you getting?

chocoholic



 
Msg#: 4223306 posted 10:48 am on Oct 29, 2010 (gmt 0)

Hi everyone i've listed some of the errors below:

Warning: fopen(http://www.buzzz.org.uk/buzzz2/wp-cron.php?doing_wp_cron) [function.fopen]: failed to open stream: HTTP request failed! in D:\phpsites\buzzz2\wp-includes\class-http.php on line 1045

Notice: register_sidebar_widget is deprecated since version 2.8! Use wp_register_sidebar_widget() instead. in D:\phpsites\buzzz2\wp-includes\functions.php on line 3237

Notice: register_widget_control is deprecated since version 2.8! Use wp_register_widget_control() instead. in D:\phpsites\buzzz2\wp-includes\functions.php on line 3237

Notice: register_sidebar_widget is deprecated since version 2.8! Use wp_register_sidebar_widget() instead. in D:\phpsites\buzzz2\wp-includes\functions.php on line 3237

Notice: register_widget_control is deprecated since version 2.8! Use wp_register_widget_control() instead. in D:\phpsites\buzzz2\wp-includes\functions.php on line 3237

Notice: register_sidebar_widget is deprecated since version 2.8! Use wp_register_sidebar_widget() instead. in D:\phpsites\buzzz2\wp-includes\functions.php on line 3237

Notice: register_widget_control is deprecated since version 2.8! Use wp_register_widget_control() instead. in D:\phpsites\buzzz2\wp-includes\functions.php on line 3237

Notice: Undefined index: activated in D:\phpsites\buzzz2\wp-content\themes\thesis_18\lib\functions\launch.php on line 21

Warning: Cannot modify header information - headers already sent by (output started at D:\phpsites\buzzz2\wp-includes\class-http.php:1045) in D:\phpsites\buzzz2\wp-content\themes\thesis_18\lib\functions\compatibility.php on line 7

Notice: Undefined variable: page_title in D:\phpsites\buzzz2\wp-content\themes\thesis_18\lib\classes\head.php on line 41

Notice: Undefined variable: conditional_styles in D:\phpsites\buzzz2\wp-content\themes\thesis_18\lib\classes\head.php on line 192

Notice: Undefined property: thesis_favicon::$favicon in D:\phpsites\buzzz2\wp-content\themes\thesis_18\lib\classes\head.php on line 249

How do i turn debug on - do i change the report_zend_debug to 1


thanks

chocoholic



 
Msg#: 4223306 posted 12:49 pm on Oct 29, 2010 (gmt 0)

Hiya..right i found the debugger in wp_config and i already had it switched on...when i switched it off the site works fine...not sure if it should be though...

penders

WebmasterWorld Senior Member penders us a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



 
Msg#: 4223306 posted 1:13 pm on Oct 29, 2010 (gmt 0)

All the 'errors' above are actually Notices and Warnings - so they aren't necessarily show stoppers.

The debugger in wp_config probably increases PHP's error_reporting level which accounts for the increase in Notices and Warnings.

However, strictly speaking, some of these Notices should really be dealt with - they are indicating a potential vunerability in the code. eg.
Notice: Undefined variable: page_title in D:\phpsites\buzzz2\wp-content\themes\thesis_18\lib\classes\head.php on line 41

This is saying that $page_title is being used in some context without it first being defined or initialised to something. This is just bad programming practise. PHP will probably default this to NULL, which casts to an empty string in a string context - so if that is OK, then it still works.

Warning: Cannot modify header information - headers already sent by (output started at D:\phpsites\buzzz2\wp-includes\class-http.php:1045) in D:\phpsites\buzzz2\wp-content\themes\thesis_18\lib\functions\compatibility.php on line 7


This is due to the Warnings/Notices output previously, so as long as there are no other 'errors' then this is OK. HTTP Response Headers (eg. Cookies) cannot be sent (again) once page content (in this case the error messages themselves) are already sent.

Notice: register_sidebar_widget is deprecated since version 2.8! Use wp_register_sidebar_widget() instead. in D:\phpsites\buzzz2\wp-includes\functions.php on line 3237


Wordpress specific Notice. Ok for now, but might break completely in future versions of Wordpress when the method is removed.

Warning: fopen(http://www.buzzz.org.uk/buzzz2/wp-cron.php?doing_wp_cron) [function.fopen]: failed to open stream: HTTP request failed! in D:\phpsites\buzzz2\wp-includes\class-http.php on line 1045


I'm not sure whether this is because the resource (http://www.buzzz.org.uk/buzzz2/wp-cron.php?doing_wp_cron) simply could not be found, or because the HTTP (protocol) wrapper is not enabled in your installation of PHP (controlled by allow_url_fopen setting in php.ini).

chocoholic



 
Msg#: 4223306 posted 2:50 pm on Oct 29, 2010 (gmt 0)

thanks penders for explaining the messages i think i might have to learn a bit more php than i thought...

rocknbil

WebmasterWorld Senior Member rocknbil us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4223306 posted 3:51 pm on Oct 29, 2010 (gmt 0)

Added note, the deprecated method error indicates you're using an old theme. You can probably do what it says - find the call to register_sidebar_widget and change it to wp_register_sidebar_widget - or see if there's an updated version of this theme.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved