LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Help with config error when trying to ftp a website (http://www.linuxquestions.org/questions/linux-newbie-8/help-with-config-error-when-trying-to-ftp-a-website-4175448510/)

benjib 02-03-2013 07:31 PM

Help with config error when trying to ftp a website
 
Hi Everyone, I am new to uploading /ftp websites on linux. I am trying to edit a config.php error but cant seem to grasp it and it is so frustrating. following is the error I get:Parse error: syntax error, unexpected T_STRING in /home/vouchers/public_html/includes/config.php on line 5

and following below are the edited config, and the original. Any help or advice given will be greatly appreciated, and hopefully I will be able to learn from it. Thanks in advance for any help given

Edited Config
<?php


define('HTTP_SERVER', ' http://localhost
define('DIR_WS_HTTP_FOLDER', ''); //public_html


define('USE_SEO_URLS', true); // Use SEO friendlt URLs.

define('ANSWERS_URL', 'http://demo.topmarketingadvice.com'); // Don't change this unless instructed by us!

// Database Settings
define('DATABASE_HOST','localhost'); // Hostname of database server. Usually 'localhost'
define('DATABASE_NAME','*******'); // The name of the database to connect to
define('DATABASE_USER','*******'); // The username to connect to the database as
define('DATABASE_PASS','**********'); // The password to use on the database

define('TABLE_PREFIX','qa_'); // prefix of table in database used by script. Leave as it is unless you have more than one install.

?>

Original Config
<?php


define('HTTP_SERVER', 'http://demo.topmarketingadvice.com'); // eg, http://localhost or http://www.mysite.com - should not be empty
define('DIR_WS_HTTP_FOLDER', ''); // path to script. Begins with slash, does not end with slash. for www.mysite.com/folder it would be /folder. For www.mysite.com it'd be left empty.


define('USE_SEO_URLS', true); // Use SEO friendlt URLs. Set to false if your server doesn't support it.

define('ANSWERS_URL', 'http://demo.topmarketingadvice.com'); // Don't change this unless instructed by us!



// Database Settings
define('DATABASE_HOST','localhost'); // Hostname of database server. Usually 'localhost'
define('DATABASE_NAME','adsensegoldmine'); // The name of the database to connect to
define('DATABASE_USER','demo'); // The username to connect to the database as
define('DATABASE_PASS','12admin34'); // The password to use on the database

define('TABLE_PREFIX','qa_'); // prefix of table in database used by script. Leave as it is unless you have more than one install.

?>

suicidaleggroll 02-04-2013 11:54 AM

The error is pretty clear. It's having trouble parsing the config on line 5. If you look at line 5, you'll see that you are missing a close quote and a close parenthesis.

benjib 02-04-2013 12:20 PM

Thanks for your response, I will keep trying to suss it out, but I am hitting a mental block or something similar and cant grasp it. I was great with html and the publishing of websites till I had a serious illness and was away from things for a while. I am trying to get there so hopefully I pick it up. I will concentrate on your answer and try from the wording in it. thanks benjib

suicidaleggroll 02-04-2013 12:22 PM

I'm not sure what there is to suss out. This has nothing to do with php, ftp, or anything else. It's a simple parsing problem in the config file on line 5.

This:
Code:

define('HTTP_SERVER', ' http://localhost
Should look like this:
Code:

define('HTTP_SERVER', 'http://localhost');

benjib 02-04-2013 12:33 PM

thanks once again for your help, tho I am a bit worried as this seems so simple yet, I just didnt see it. Seems simple script to upload as well. Cheers for advice :o) benjib.

As I thought, tried details above and get same error, just an idiot in php coding I think.

benjib 02-04-2013 02:37 PM

Can anyone help me with the best place to get information on editing a config.php file. The one above seems fairly easy, yet I am struggling. Thanks in advance if anyone can help

benjib 02-04-2013 04:58 PM

I have created the database and user, but cant find how to create the tables using the create_tables.sql. Can anyone advise on this please

chrism01 02-05-2013 12:39 AM

create_tables.sql is an SQL file, so just login to DB and run it manually. Its only run once at creation, so no point in automating unless you REALLY want to.

benjib 02-05-2013 06:14 AM

Thanks Chris, just a bit cautious as this is my first project at uploading to my hosting account

benjib 02-05-2013 11:49 AM

I seem to be hitting a problem where it all looks ok and when I try the site I get the following

Warning: mysql_query() [function.mysql-query]: Access denied for user 'vouchers'@'localhost' (using password: NO) in /home/vouchers/public_html/index.php on line 8

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/vouchers/public_html/index.php on line 8
No Categories.

Can anyone assist please, thanks in advance

chrism01 02-05-2013 07:49 PM

Code:

Access denied for user 'vouchers'@'localhost' (using password: NO)
You need to fix this first.
Login manually at the cli and check you can login as that user to the DB, then double check your code.

The 2nd msg seems(?) to indicate it thinks the DB is on a remote server, or you've specified the hostname you would get via eg eth0 instead of localhost.

BTW, please use code tags to show your code/msgs https://www.linuxquestions.org/quest...do=bbcode#code


All times are GMT -5. The time now is 02:57 PM.