going from php4.4.8 to php5.2.5 results in error in class_postbit when viewing thread

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dvsDave
    Member
    • Nov 2005
    • 46
    • 4.0.x

    going from php4.4.8 to php5.2.5 results in error in class_postbit when viewing thread

    If I set my php to be handled by php5 (version 5.2.5) I get an error message above the header when I look at any thread.

    The error is as follows (repeated many times)
    Code:
    Warning: array_merge() [function.array-merge]: Argument #1 is not an array in [path]/includes/class_postbit.php(293) : eval()'d code on line 21
    
    Warning: array_intersect() [function.array-intersect]: Argument #1 is not an array in [path]/includes/class_postbit.php(293) : eval()'d code on line 22
    Anybody else have this error or is there a known fix? My host is JaguarPC and they are running SuPHP

    Here are their instructions for migrating to php5 and the specific things to make sure of. (btw, I'm not using .htaccess to move between php4 and php5, there is a neat option in their hosting controlpanel which sets it to either 4 or 5 (which is really nice)
    Originally posted by JaguarPC
    Secure PHP
    1. IMPORTANT: PHP4 end of life announcement - July 13th, 2007
    2. PHP scripts now run using the userid of the account holder instead of apache web server user "nobody". This is done using suPHP.
    3. World writable folders (chmod 777) are not required for file uploads through php.
    4. php file (script) does not need 755 permissions. 644 is fine. In fact 400 or 600 is ok too (especially good for sensitive information).
    5. php_flag or php_value can NOT be used in .htaccess files (It will result in Internal Server Error).
    6. The php flags that do not work in .htaccess can be moved to php.ini file in the same folder where php script exists. However, the php flag/value will be in the format of php.ini and not that of .htaccess. For example this from .htaccess php_flag register_globals off
      will go into php.ini as:
      register_globals off
      If php.ini exists in the folder where the php scripts exists and executes, it will take all values from it (and nothing will be taken from main php.ini, and hence Zend Optimizer and other stuff that is defined in main php.ini will not work with a replacement php.ini that does not have those defined. Therefore you can download the latest server wide php.ini from here for php4 and from here for php5. To open the file on your computer, you may need a better editor than Notepad that can read unix line breaks.
      If you are setting up custom php settings, the custom php.ini file will be required in a folder where the php script needs to execute. Or you can place php.ini anywhere and have this directive in public_html/.htaccess
      suPHP_ConfigPath /home/username/php5-config
      where username is your cpanel account username, and php5-config is just a folder name (you can name it anything) and it will pick php.ini from that folder.
    7. If the folder that contains a php file/script is world writable (chmod 777), it will result in Internal Server Error. This is similar to cgi/perl scripts that do not like such permissions for security reason. The normal folder permissions should be 755.
    8. You can not use webdav to publish php files/sites because webdav setup requires world writable folders (very insecure in shared environment) and php now being secured would not like that. You can continue to use webdav for publishing calendar files etc. on your own risk.
    9. Apache specific php functions will no longer work: http://www.php.net/manual/en/ref.apache.php
    10. ZenCart/osCommerce checks if its configure.php file is writable (since php is being run with userid it should be), so it will complain that its writable. Please change the permissions to 444 via ssh.
    11. The directive "AddType application/x-httpd-php" in .htaccess in old php is now "AddHandler application/x-httpd-php4" or "AddHandler application/x-httpd-php5" depending on what php version you are using.
    12. If you are using ForceType in .htaccess to force a file to be treated as php, you will need to change it to SetHandler
  • Lynne
    Former vBulletin Support
    • Oct 2004
    • 26255

    #2
    This should help - [Fix How to] PHP 5 and array_merge errors

    Please don't PM or VM me for support - I only help out in the threads.
    vBulletin Manual & vBulletin 4.0 Code Documentation (API)
    Want help modifying your vbulletin forum? Head on over to vbulletin.org
    If I post CSS and you don't know where it goes, throw it into the additional.css template.

    W3Schools <- awesome site for html/css help

    Comment

    • dvsDave
      Member
      • Nov 2005
      • 46
      • 4.0.x

      #3
      Got it nailed down. It was actually a plugin at the postbit_display_complete hook. It was the VBSEO Conditional Signatures product that was giving me the error.

      Comment

      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
      Working...