Page 1 of 1

Parse error - please help

Posted: Tue Apr 25, 2006 8:56 am
by TLT
Hey there,

I'm kinda new here but I'll try to get familliar with PHP while browsing the forum and doing the stuff.

I have a website running on MySQL 4.0.18-Max via TCP/IP. It's running on ISP server, I just connect with all the rights. I have uploaded phpMyAdmin-2.8.0.3 and installed as mentioned in documentation. Alas... When I try to load index.php, I get an error displayed by web browser (doesn't matter it is latest firefox or ie):

Parse error: parse error, expecting `')'' in ./libraries/Theme.class.php on line 66

And the line 66 in Theme.class.php looks like OK:
} elseif ( isset( $theme_generation, $theme_version ) ) {

The strangest thing is the `')'' Wtf?

Any help would be appreciated. Thanks.

Posted: Tue Apr 25, 2006 9:50 am
by bimbo
the problem shown actually lies around the line no. shown. In ur case it should be near above line 66 so please check above line 66 or send the code

Posted: Wed Apr 26, 2006 7:09 am
by TLT
feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Code: Select all

function loadInfo() {
        if ( ! file_exists( $this->getPath() . '/info.inc.php' ) ) {
            return false;
        }

        if ( $this->mtime_info === filemtime( $this->getPath() . '/info.inc.php' ) ) {
            return true;
        }

        @include( $this->getPath() . '/info.inc.php' );

        // did it set correctly?
        if ( ! isset( $theme_name ) ) {
            return false;
        }

        $this->mtime_info = filemtime( $this->getPath() . '/info.inc.php' );

        if ( isset( $theme_full_version ) ) {
            $this->setVersion( $theme_full_version );
        } elseif ( isset( $theme_generation, $theme_version ) ) {
            $this->setVersion( $theme_generation . '.' . $theme_version );
        }
        $this->setName( $theme_name );

        return true;
    }
OK, I have bolded the line 66. I tried to search the `')'' symbols. ` is absent in document, so I can't understand why it's in the error message. And I found this line kinda suspicios:

' onclick="takeThis(\'' . addslashes( $this->getId() ) . '\');'


:roll:


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Wed Apr 26, 2006 10:03 am
by feyd
Your version of php may not like the multiple variables to isset() maybe.

bimbo, read your private messages.

Posted: Fri Apr 28, 2006 2:52 am
by TLT
Sorry and thanks for the correcting my code.

server php version is 4.3.4 and the server's settings are below:
http://gintas.is.lt/info.php

and how I could solve isset() problem?

Posted: Fri Apr 28, 2006 6:03 am
by shiznatix

Code: Select all

} elseif ( isset( $theme_generation) && isset($theme_version ) ) {

Posted: Tue May 02, 2006 2:02 am
by TLT
shiznatix wrote:

Code: Select all

} elseif ( isset( $theme_generation) && isset($theme_version ) ) {
Well, that doesn't help me much :roll:

Is this problem from client (that means my) side or server? Because I don't believe phpMyAdmin is buggy 'cause it's latest version and I didn't hear any problems from the other guys.

Posted: Wed May 03, 2006 7:53 am
by TLT
Next. I have deleted phpMyAdmin-2.8.0.3 and uploaded phpMyAdmin-2.7.0-pl2 instead.
Now I get same looking error while trying to open index.php:
Parse error: parse error, expecting `')'' in ./libraries/grab_globals.lib.php on line 32

And the code in grab_globals.lib.php looks like:

Code: Select all

foreach ( get_defined_vars() as $key => $value ) {
    if ( ! in_array( $key, $variables_whitelist )  ) {
        unset( $$key );
    }
}
unset( $key, $value );

// protect against older PHP versions' bug about GLOBALS overwrite
// (no need to translate this one  )
// but what if script.php?GLOABLS[admin]=1&GLOBALS[_REQUEST]=1 ???
if ( isset( $_REQUEST['GLOBALS'] ) || isset( $_FILES['GLOBALS'] )
  || isset( $_SERVER['GLOBALS'] ) || isset( $_COOKIE['GLOBALS'] )
  || isset( $_ENV['GLOBALS'] ) ) {
    die( 'GLOBALS overwrite attempt' );
}
I don't beliece phpMyAdmin being bugy.
And the line 32 is (you can see it in the php code):
unset( $key, $value );

Could that be because of incorrect config.inc.php configuration? :roll:

Posted: Wed May 03, 2006 9:22 am
by Ollie Saunders
they aren't necessarily bugs. phpMyAdmin is PHP code and is therefore subject to the variences in PHP configurations, which there are many.
Could that be because of incorrect config.inc.php configuration?
Yeah you've hit the nail on the head.
Its possible you have your server configured in such a way that phpMyAdmin won't run. Have a look in the phpMyAdmin documentation for the PHP requirements and ensure your server meets them all. Start with the PHP version and then look to more specific requirements and configuration directives.
Is this problem from client (that means my) side or server?
Parse errors pointing to PHP files are always server side.