Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Error problem


Tartanpig

Recommended Posts

Can someone point me in the right direction for a solution to this error.

 

[Parse error

 

: syntax error, unexpected T_STRING in /home/content/s/t/a/xxxxxxxx/html/admin/includes/application_top.php on line 42]

 

 

I cannot see anything wrong with line 42. If I comment out the line the error shows up as the next line and so on..

 

 

 

The surrounding code is shown below (line 41 shown).:-

 

// set php_self in the local scope - osC_sec inserted here.

 

if ( empty( $PHP_SELF ) ) $PHP_SELF = ( ( ( strlen( ini_get( 'cgi.fix_pathinfo' ) ) > 0 ) && ( ( bool ) ini_get( 'cgi.fix_pathinfo' ) == false ) ) || !isset( $HTTP_SERVER_VARS[ 'SCRIPT_NAME' ] ) ) ? basename( $HTTP_SERVER_VARS[ 'PHP_SELF' ] ) : basename( $HTTP_SERVER_VARS[ 'SCRIPT_NAME' ] ); 

 

 

 

 

 

41 [ // Used in the "Backup Manager" to compress backups

 

define('LOCAL_EXE_GZIP', '/usr/bin/gzip');

 

define('LOCAL_EXE_GUNZIP', '/usr/bin/gunzip');

 

define('LOCAL_EXE_ZIP', '/usr/local/bin/zip');

 

define('LOCAL_EXE_UNZIP', '/usr/local/bin/unzip');

 

// include the list of project filenames

 

require(DIR_WS_INCLUDES . 'filenames.php'); ]

 

 

 

 

 

You will recognise the security code that was inserted above. Is it perhaps the security code?

 

Link to comment
Share on other sites

Post more code.

 

Say lines 30 to 50.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

T_STRING errors are caused by incorrect php code. I used to see them alot when I first started. Likely you missed a ' or forgot to escape one. As Germ said post more of the application top lines and one of should be able to spot it for you.

Link to comment
Share on other sites

Post more code.

 

Say lines 30 to 50.

 

 

 

 

 

Germ kere is the extra code you rquested lines 19 - 62 Thanks :-

 

 

[ // check support for register_globals

if (function_exists('ini_get') && (ini_get('register_globals') == false) && (PHP_VERSION < 4.3) ) {

exit('Server Requirement Error: register_globals is disabled in your PHP configuration. This can be enabled in your php.ini configuration file or in the .htaccess file in your catalog directory. Please use PHP 4.3+ if register_globals cannot be enabled on the server.');

}

 

// Set the local configuration parameters - mainly for developers

if (file_exists('includes/local/configure.php')) include('includes/local/configure.php');

 

// Include application configuration parameters

require('includes/configure.php');

require(DIR_FS_CATALOG . 'includes/osc_sec.php');

// Define the project version

define('PROJECT_VERSION', 'osCommerce Online Merchant v2.2 RC2a');

 

// some code to solve compatibility issues

require(DIR_WS_FUNCTIONS . 'compatibility.php');

 

// set php_self in the local scope - osC_sec inserted here

if ( empty( $PHP_SELF ) ) $PHP_SELF = ( ( ( strlen( ini_get( 'cgi.fix_pathinfo' ) ) > 0 )

&& ( ( bool ) ini_get( 'cgi.fix_pathinfo' ) == false ) ) || !isset( $HTTP_SERVER_VARS

[ 'SCRIPT_NAME' ] ) ) ? basename( $HTTP_SERVER_VARS[ 'PHP_SELF' ] ) : basename

( $HTTP_SERVER_VARS[ 'SCRIPT_NAME' ] );

 

 

 

// Used in the "Backup Manager" to compress backups

define('LOCAL_EXE_GZIP','/usr/bin/gzip');

define('LOCAL_EXE_GUNZIP','/usr/bin/gunzip');

define('LOCAL_EXE_ZIP','/usr/local/bin/zip');

define('LOCAL_EXE_UNZIP','/usr/local/bin/unzip');

 

// include the list of project filenames

require(DIR_WS_INCLUDES . 'filenames.php');

 

// include the list of project database tables

require(DIR_WS_INCLUDES . 'database_tables.php');

 

// customization for the design layout

define('BOX_WIDTH', 125); // how wide the boxes should be in pixels (default: 125)

 

// Define how do we update currency exchange rates

// Possible values are 'oanda' 'xe' or ''

define('CURRENCY_SERVER_PRIMARY', 'oanda');

define('CURRENCY_SERVER_BACKUP', 'xe'); ]

 

 

 

Link to comment
Share on other sites

Check this line in the source on your server:

 

if ( empty( $PHP_SELF ) ) $PHP_SELF = ( ( ( strlen( ini_get( 'cgi.fix_pathinfo' ) ) > 0 ) && ( ( bool ) ini_get( 'cgi.fix_pathinfo' ) == false ) ) || !isset( $HTTP_SERVER_VARS[ 'SCRIPT_NAME' ] ) ) ? basename( $HTTP_SERVER_VARS[ 'PHP_SELF' ] ) : basename( $HTTP_SERVER_VARS[ 'SCRIPT_NAME' ] );

 

The code needs to be all on one long line.

 

Looks like you may have edited it with a text editor that had "Wordwrap" on or just inserted line breaks where it shouldn't have.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

Check this line in the source on your server:

 

if ( empty( $PHP_SELF ) ) $PHP_SELF = ( ( ( strlen( ini_get( 'cgi.fix_pathinfo' ) ) > 0 ) && ( ( bool ) ini_get( 'cgi.fix_pathinfo' ) == false ) ) || !isset( $HTTP_SERVER_VARS[ 'SCRIPT_NAME' ] ) ) ? basename( $HTTP_SERVER_VARS[ 'PHP_SELF' ] ) : basename( $HTTP_SERVER_VARS[ 'SCRIPT_NAME' ] );

 

The code needs to be all on one long line.

 

Looks like you may have edited it with a text editor that had "Wordwrap" on or just inserted line breaks where it shouldn't have.

 

 

Yip That was exactly on the button. I had edited it into separate lines myself for easier reading. You guys are great.

 

 

But now I have run into another ...... [Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/usr/local/mysql-5.0/data/mysql.sock' (2) in /home/content/s/t/a/xxxxxxxxxx/html/admin/includes/functions/database.php on line 19

Unable to connect to database server! ]

 

 

It's never ending fun Any ideas?

Link to comment
Share on other sites

Either a temporary "hiccup" on the server or the DB credentials in the /admin/includes/configure.php file are incorrect.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

Either a temporary "hiccup" on the server or the DB credentials in the /admin/includes/configure.php file are incorrect.

 

 

 

 

Thanks Again germ. I'll have a look at the congigure file

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...