Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Parse error when trying to access admin folder


rachidk

Recommended Posts

Hi all

 

I just finished installing the Ver 2.2 RC and when I try to go to the admin folder, I get the below PHP error:

 

Parse error: syntax error, unexpected $end in /home/a2426822/public_html/catalog/admin/includes/functions/general.php on line 509

 

Any clues ??

 

I am newbie by the way :(

 

Cheers

 

rachidk

Link to comment
Share on other sites

Hi all

 

I just finished installing the Ver 2.2 RC and when I try to go to the admin folder, I get the below PHP error:

 

Parse error: syntax error, unexpected $end in /home/a2426822/public_html/catalog/admin/includes/functions/general.php on line 509

 

Any clues ??

 

I am newbie by the way :(

 

Cheers

 

rachidk

Are you installing a template?

Link to comment
Share on other sites

PHP files should be uploaded in ASCII or TEXT mode.

 

BINARY mode should be used for image files.

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

Are you installing a template?

 

Thanks for the reply.

 

No I am not using any template. I only did the installation based on the help files and installation guide provided in the package. The installation went on fine until the last screen where it gives you the choice of either going into the catalog or administration.

 

The catalog works fine whereas the administration (which sends you to catalog/admin) that's when the php error showed up.

 

I am stuck because I am unable to login to the admin page. I guess there must be a work around.

 

Regards

 

Rachidk

Link to comment
Share on other sites

I guess there must be a work around.

FTP or cPanel

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

Did you upload everything in binary mode? One of my uploads was accidentally in ASCII mode and it gave me parse errors too.

 

I used filezilla to upload the whole unzipped files from the local hard drive to the providers site. No errors was noted.

 

regards

Link to comment
Share on other sites

What osC version are you installing?

:unsure:

 

The file in question has over 1300 lines

 

How many lines does the one on your local PC 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

What osC version are you installing?

:unsure:

 

The file in question has over 1300 lines

 

How many lines does the one on your local PC have?

 

The file general.php has 1307 lines actually. The edited portion of the file from line 502 to 509 contains the following:-

 

function tep_get_products_name($product_id, $language_id = 0) {

global $languages_id;

 

if ($language_id == 0) $language_id = $languages_id;

$product_query = tep_db_query("select products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'");

$product = tep_db_fetch_array($product_query);

 

return $product['products_name']; <------------------ this is line 509 !!

 

 

Incidently I tried last night and re-installed all over again. Same error happens ! :huh:

 

 

Rachidk

Link to comment
Share on other sites

Incidently I tried last night and re-installed all over again. Same error happens ! :huh:

So you're saying that a brand new, unmodified, fresh install of osC is producing this error? Are you certain your host supports everything that osC needs?

-Dorian

Link to comment
Share on other sites

So you're saying that a brand new, unmodified, fresh install of osC is producing this error? Are you certain your host supports everything that osC needs?

 

Well yes Dorian, I suppose so.

 

I had no problem to install osC. The dbase was imported correctly, I changed the chmod of the relative files without any hassles. As I mentioned before, when the installation is completed, you are taken to a page where you can select either Catalog or Administration.

 

The Catalog works fine while the Administration comes up with the parse error.

 

Any clues

 

Rachidk

Link to comment
Share on other sites

The file general.php has 1307 lines actually. The edited portion of the file from line 502 to 509 contains the following:-

 

function tep_get_products_name($product_id, $language_id = 0) {

global $languages_id;

 

if ($language_id == 0) $language_id = $languages_id;

$product_query = tep_db_query("select products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'");

$product = tep_db_fetch_array($product_query);

 

return $product['products_name']; <------------------ this is line 509 !!

 

 

Incidently I tried last night and re-installed all over again. Same error happens ! :huh:

 

 

Rachidk

Are you installing RC2 or RC2a. The RC2a file differs in the location of the code you posted (although the code is the same).

Link to comment
Share on other sites

FWIW, I just did two new installs of v2.2 RC2a. One was on my production server; the other was locally with MAMP. Both installed and the page that chooses CATALOG or ADMIN TOOL both work.

-Dorian

Link to comment
Share on other sites

Rachidk:

 

Who is your host? Do they offer osC installation via Fantastico or some other automated script? Have you tried contacting them to see why this error is happening?

-Dorian

Link to comment
Share on other sites

And is line 510 } ?

 

  function tep_get_products_name($product_id, $language_id = 0) {
global $languages_id;

if ($language_id == 0) $language_id = $languages_id;
$product_query = tep_db_query("select products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'");
$product = tep_db_fetch_array($product_query);

return $product['products_name'];
 }

 function tep_get_products_description($product_id, $language_id) {

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

And is line 510 } ?

 

  function tep_get_products_name($product_id, $language_id = 0) {
global $languages_id;

if ($language_id == 0) $language_id = $languages_id;
$product_query = tep_db_query("select products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language_id . "'");
$product = tep_db_fetch_array($product_query);

return $product['products_name'];
 }

 function tep_get_products_description($product_id, $language_id) {

Thanks Geoffrey, I was going to post that.

 

rachidk

Geoffrey posted lines 502 to 512.

 

Is it possible that you posted the wrong lines, or somehow you general.php file has some missing lines?

Link to comment
Share on other sites

If the file in question in the original install is corrupt, maybe using the same file from the same osC version but downloaded from a different source will solve the problem.

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

If the file in question in the original install is corrupt, maybe using the same file from the same osC version but downloaded from a different source will solve the problem.

 

Germ and all

 

The line 510 ends with }.

 

Well I am so lost in this install already !!. I have done what is plausible to do like re-uploading everything, re-installation process, overwriting the general.php, editing it to see what went wrong between the original prior to installation process.

I am sure I might be missing something silly there.... But it is starting to get on my nerves somehow though.

 

I contacted the host and they said that it is a software problem and they cant do much...

 

The host has Fantastico installer also.

 

I will give it for today and come back tomorrow ..

 

Anyway thanks everyone

Link to comment
Share on other sites

Try posting the same range of lines I did plus 5 before and after.

 

G

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

Germ and all

 

The line 510 ends with }.

 

Well I am so lost in this install already !!. I have done what is plausible to do like re-uploading everything, re-installation process, overwriting the general.php, editing it to see what went wrong between the original prior to installation process.

I am sure I might be missing something silly there.... But it is starting to get on my nerves somehow though.

 

I contacted the host and they said that it is a software problem and they cant do much...

 

The host has Fantastico installer also.

 

I will give it for today and come back tomorrow ..

 

Anyway thanks everyone

Did you get osc from the blue solutions tab at the top of this page?

 

You may get an older version if you use fantastico.

 

Do what Geoffrey said about posting the lines he suggested.

Link to comment
Share on other sites

Find out what version your osCommerce is here:

 

What version is my shop?

 

If you have osCommerce-2.2rc2a download it here: click me

 

Other versions can be downloaded here: click me

 

Extract the file you need and upload it (only the file causing your problems!) into your admin. It can't be any worse than the one you already have (that won't work).

 

One definition of insanity (my favorite) is doing the same thing over and over expecting different results.

 

It sure appears to me like there's a glitch in the fileset you're using.

 

I'd say it's time for a new deck of cards to play with.

;)

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

  • 2 weeks later...

Hi and thanks to all who replied to me following my recent problems in the installation of OSC.

 

I finally made it and OSC is now fully functional. I uploaded a fresh version and installation went fine. I presume the problem was caused by the ftp software whose timeout was a bit short and whenever the internet connection lag, not all the files are being transferred.

 

Thank you again guys !!!

 

Rachid

 

 

Find out what version your osCommerce is here:

 

What version is my shop?

 

If you have osCommerce-2.2rc2a download it here: click me

 

Other versions can be downloaded here: click me

 

Extract the file you need and upload it (only the file causing your problems!) into your admin. It can't be any worse than the one you already have (that won't work).

 

One definition of insanity (my favorite) is doing the same thing over and over expecting different results.

 

It sure appears to me like there's a glitch in the fileset you're using.

 

I'd say it's time for a new deck of cards to play with.

;)

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...