Server issue Can't register without outcommenting a ZEND file

Marcus

Well-known member
When I click on the login/register of my forum there is an error if I click on register and have a username already filled in. If I let this field empty, then I can access the register page. However then I also can't complete registration as the page /register/register gives me a " Fatal error: require(): Cannot redeclare class zend_loader in /var/www/vhosts/domain.com/httpdocs/library/Zend/Validate.php on line 201 " error. Same error is for /login/login

After outcommenting the 201th require_once line in library/Zend/Validate.php it works!
Code:
    public static function is($value, $classBaseName, array $args = array(), $namespaces = array())
    {
        $namespaces = array_merge((array) $namespaces, self::$_defaultNamespaces, array('Zend_Validate'));
        $className  = ucfirst($classBaseName);
        try {
            if (!class_exists($className, false)) {
                //           require_once 'Zend/Loader.php';
                foreach($namespaces as $namespace) {
                    $class = $namespace . '_' . $className;
                    $file  = str_replace('_', DIRECTORY_SEPARATOR, $class) . '.php';
                    if (Zend_Loader::isReadable($file)) {
                        Zend_Loader::loadClass($class);
                        $className = $class;
                        break;
                    }
                }
            }
 
The Zend_Loader should not be used and this condition (!class_exists($className, false)) should never be true as XenForo provides its own autoloader. The problem must be elsewhere.
Make sure there is no missing file in library/.
 
I have reuploaded all origina xenforo files. The problem is still there, until I outcomment the line in Validate.php.
 
I have deactivated all products in ACP now and the problem is still there. I also deactivated products with the config.php line before.
 
I get this message:

Code:
 EmailAddressEmailAddress

Umm, that shouldn't be double. For example, the user datawriter in XenForo calls that function:

Code:
		if (Zend_Validate::is($username, 'EmailAddress'))
		{
			$this->error(new XenForo_Phrase('please_enter_name_that_does_not_resemble_an_email_address'), 'username');
			return false;
		}

Just one 'EmailAddress'. So unless there is an addon or file modification changing the string literal then I am inclined to blame the APC cache or possibly ionCube like I said in the ticket. Basically we are looking at 'excess' PHP extensions as possible troublemakers.
 
Without IonCube it is not working. And I already disabled APC cache for Xenforo before. I will make a clean xenforo install and within a new database on the server and try it with that.
 
And I already disabled APC cache for Xenforo before.

I tried that too. But note that you are using two different caches. APC can function as both a memory cache and an opcode cache. You are using both. The opcode cache is suspect in this case.

I only tried disabling the memory cache by commenting the cache configuration in your library/config.php file. The opcode cache is more transparent and doesn't involve any special configuration in XenForo. You would have to remove the APC extension from PHP to disable the opcode cache.
 
I get this message:

Code:
 EmailAddressEmailAddress

Umm, that shouldn't be double. For example, the user datawriter in XenForo calls that function:

Code:
		if (Zend_Validate::is($username, 'EmailAddress'))
		{
			$this->error(new XenForo_Phrase('please_enter_name_that_does_not_resemble_an_email_address'), 'username');
			return false;
		}

Just one 'EmailAddress'. So unless there is an addon or file modification changing the string literal then I am inclined to blame the APC cache or possibly ionCube like I said in the ticket. Basically we are looking at 'excess' PHP extensions as possible troublemakers.

Err... nevermind. This doesn't necessarily indicate a problem. That function can be called multiple times resulting in multiple echos. The user datawriter has 3 possible calls to that function.
 
I suspect this is likely caused by an include_path being set via a php_admin_value in a vhost/httpd.conf file to a location that includes ZF but not our version of ZF. Unfortunately, it's basically impossible for us to work around that.
 
Top Bottom