Jan 1, 2003
13
0
151
Hello all,

When trying to open phpMyAdmin on one of our cPanel servers, we get the following error:

Parse error: parse error in /usr/local/cpanel/base/3rdparty/phpMyAdmin/index.php on line 47


I haven't run into this before - I tried running upcp hoping it would overwrite whatever the problem was, no luck unfortunately.

Is there a quick fix for this? I didn't see anything in the /scripts folder that seemed appropriate.

Is it wise to simply copy a working index.php file over from another cPanel server or would that break things?
 
Jan 1, 2003
13
0
151
I just tried copying over the index.php file from a server where it is working properly.

I'm still getting the same parse error on line 47.

Following is the output from the 'diff' command suggested above... I don't know PHP so it's really Greek to me.

Any suggestions would be wonderful; I'd love to know a way to rebuild phpMyAdmin.

----------------
[/usr/local/cpanel/3rdparty/phpMyAdmin]# diff index.php index.OLD
2,3c2
< /* $Id: index.php,v 1.36 2003/01/08 13:50:27 nijel Exp $ */
< // vim: expandtab sw=4 ts=4 sts=4:
---
> /* $Id: index.php,v 1.21 2001/10/19 14:05:30 loic1 Exp $ */
13c12
< PMA_setFontSizes();
---
> set_font_sizes();
16d14
< // loic1 - 2001/25/11: use the new globals arrays defined with php 4.1+
18,21c16
< if (!empty($_ENV) && isset($_ENV['HTTP_HOST'])) {
< $HTTP_HOST = $_ENV['HTTP_HOST'];
< }
< else if (!empty($HTTP_ENV_VARS) && isset($HTTP_ENV_VARS['HTTP_HOST'])) {
---
> if (!empty($HTTP_ENV_VARS) && isset($HTTP_ENV_VARS['HTTP_HOST'])) {
36,43c31,33
< // loic1: If left light mode -> urldecode the db name
< if (isset($lightm_db)) {
< $db = urldecode($lightm_db);
< unset($lightm_db);
< }
< $url_query = PMA_generate_common_url(isset($db) ? $db : '');
<
< header('Content-Type: text/html; charset=' . $GLOBALS['charset']);
---
> $url_query = 'lang=' . $lang
> . '&amp;server=' . $server
> . (empty($db) ? '' : '&amp;db=' . urlencode($db));
45c35,36
< <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
---
> <!DOCTYPE html
> PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
47c38
< <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $available_languages[$lang][2]; ?>" lang="<?php echo $available_languages[$lang][2]; ?>" dir="<?php echo $text_dir; ?>">
---
> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $available_languages[$lang][2]; ?>" lang="<?php echo $available_languages[$lang][2]; ?>">
49,50c40
< <title>phpMyAdmin <?php echo PMA_VERSION; ?> - <?php echo $HTTP_HOST; ?></title>
< <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $GLOBALS['charset']; ?>" />
---
> <title>phpMyAdmin <?php echo PHPMYADMIN_VERSION; ?> - <?php echo $HTTP_HOST; ?></title>
58c48
< <frameset cols="<?php echo $cfg['LeftWidth']; ?>,*" rows="*">
---
> <frameset cols="<?php echo $cfgLeftWidth; ?>,*" rows="*">
60c50
< <frame src="<?php echo (empty($db)) ? 'main.php' : $cfg['DefaultTabDatabase']; ?>?<?php echo $url_query; ?>" name="phpmain" />
---
> <frame src="<?php echo (empty($db)) ? 'main.php' : 'db_details.php'; ?>?<?php echo $url_query; ?>" name="phpmain" />
 

dgbaker

Well-Known Member
PartnerNOC
Sep 20, 2002
2,531
10
343
Toronto, Ontario Canada
cPanel Access Level
DataCenter Provider
Since phpmyadmin is all selfcontained in one directory I would do the following.

On a working server

cd /usr/local/cpanel/3rdParty
tar -cvf phpadmin.tar phpMyAdmin

Then ftp that over to the broken server to the same path then do,

cd /usr/local/cpanel/3rdParty
mv phpMyAdmin phpMyAdmin.old
tar -xvof phpadmin.tar
 
Jan 1, 2003
13
0
151
I did indeed just copy over the phpMyAdmin directory from a server where it was (and still is) working.

I *still* get

:Parse error: parse error in /usr/local/cpanel/base/3rdparty/phpMyAdmin/index.php on line 47


I had a look at line 47 - it was a blank line. I deleted the blank line. I still get a parse error at line 47. How can this be? Am I overlooking something that should be glaringly obvious?

I also tried taking the text of a working index.php, putting it into Notepad as a Brand New File and uploading it manually to the server.

Also ran /scripts/mysql just to see if it would fix anything, and restarted SQL service. Still no dice.
 
Jan 1, 2003
13
0
151
Fix for this:


1. Replace the phpMyAdmin folder with a working folder from another machine.

2. Run upcp!

Madness, I say.