Parse error - please help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
TLT
Forum Newbie
Posts: 5
Joined: Tue Apr 25, 2006 8:39 am

Parse error - please help

Post 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.
bimbo
Forum Newbie
Posts: 3
Joined: Tue Apr 25, 2006 3:36 am

Post 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
TLT
Forum Newbie
Posts: 5
Joined: Tue Apr 25, 2006 8:39 am

Post 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]
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Your version of php may not like the multiple variables to isset() maybe.

bimbo, read your private messages.
TLT
Forum Newbie
Posts: 5
Joined: Tue Apr 25, 2006 8:39 am

Post 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?
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post by shiznatix »

Code: Select all

} elseif ( isset( $theme_generation) && isset($theme_version ) ) {
TLT
Forum Newbie
Posts: 5
Joined: Tue Apr 25, 2006 8:39 am

Post 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.
TLT
Forum Newbie
Posts: 5
Joined: Tue Apr 25, 2006 8:39 am

Post 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:
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post 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.
Post Reply