LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 02-03-2013, 07:31 PM   #1
benjib
LQ Newbie
 
Registered: Feb 2013
Posts: 7

Rep: Reputation: Disabled
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.

?>
 
Old 02-04-2013, 11:54 AM   #2
suicidaleggroll
Senior Member
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 2,816

Rep: Reputation: 996Reputation: 996Reputation: 996Reputation: 996Reputation: 996Reputation: 996Reputation: 996Reputation: 996
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.
 
1 members found this post helpful.
Old 02-04-2013, 12:20 PM   #3
benjib
LQ Newbie
 
Registered: Feb 2013
Posts: 7

Original Poster
Rep: Reputation: Disabled
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
 
Old 02-04-2013, 12:22 PM   #4
suicidaleggroll
Senior Member
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 2,816

Rep: Reputation: 996Reputation: 996Reputation: 996Reputation: 996Reputation: 996Reputation: 996Reputation: 996Reputation: 996
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');

Last edited by suicidaleggroll; 02-04-2013 at 12:56 PM. Reason: missed the semicolon
 
1 members found this post helpful.
Old 02-04-2013, 12:33 PM   #5
benjib
LQ Newbie
 
Registered: Feb 2013
Posts: 7

Original Poster
Rep: Reputation: Disabled
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 ) benjib.

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

Last edited by benjib; 02-04-2013 at 03:08 PM.
 
Old 02-04-2013, 02:37 PM   #6
benjib
LQ Newbie
 
Registered: Feb 2013
Posts: 7

Original Poster
Rep: Reputation: Disabled
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
 
Old 02-04-2013, 04:58 PM   #7
benjib
LQ Newbie
 
Registered: Feb 2013
Posts: 7

Original Poster
Rep: Reputation: Disabled
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

Last edited by benjib; 02-04-2013 at 06:10 PM.
 
Old 02-05-2013, 12:39 AM   #8
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,269

Rep: Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028
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.
 
Old 02-05-2013, 06:14 AM   #9
benjib
LQ Newbie
 
Registered: Feb 2013
Posts: 7

Original Poster
Rep: Reputation: Disabled
Thanks Chris, just a bit cautious as this is my first project at uploading to my hosting account
 
Old 02-05-2013, 11:49 AM   #10
benjib
LQ Newbie
 
Registered: Feb 2013
Posts: 7

Original Poster
Rep: Reputation: Disabled
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
 
Old 02-05-2013, 07:49 PM   #11
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,269

Rep: Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
auto-ftp to my website? leeko Linux - General 6 08-15-2008 07:02 PM
Config Error: Error accessing config file: /etc/yum.conf dr_zayus69 Linux - Software 2 01-17-2006 05:20 PM
How do I FTP enable a website? imsam Linux - Newbie 3 11-29-2004 04:05 PM
Managing FTP trough Website Emzer Linux - Software 2 10-23-2004 02:28 PM


All times are GMT -5. The time now is 11:22 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration