Author Topic: Errors  (Read 685 times)

Soad

  • New Member
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Errors
« on: June 07, 2010, 02:04:56 AM »
Am trying to connect a web form to a mysql database created in cpanel but have the following errors:

Warning:  include(config.inc.php) [function.include]: failed to open stream: No such file or directory in /home/warranty/public_html/database/processor.php on line 7
 
  Warning:  include(config.inc.php) [function.include]: failed to open stream: No such file or directory in /home/warranty/public_html/database/processor.php on line 7
 
  Warning:  include() [function.include]: Failed opening 'config.inc.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/warranty/public_html/database/processor.php on line 7
 
  Warning:  mysql_connect() [function.mysql-connect]: Access denied for user 'warranty'@'localhost' (using password: NO) in /home/warranty/public_html/database/processor.php on line 8
  Could not connect to database: Access denied for user 'warranty'@'localhost' (using password: NO)

Any help would be gratefully recieved for a newbie

PHP Coder

  • Expert PHP Helper
  • Senior Member
  • *****
  • Posts: 130
  • Karma: +0/-0
    • View Profile
    • PHP coder
Re: Errors
« Reply #1 on: June 07, 2010, 03:10:40 AM »
As it is stated in the warning message, program can not locate file config.inc.php
Make sure this file is uploaded to the appropriate directory (check file processor.php line #7 to find out path to config.inc.php)
PHP coder for hire

Soad

  • New Member
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Errors
« Reply #2 on: June 07, 2010, 06:38:01 AM »
Thanks

Where can I find this file I cant seem to see it in cpanel

Thanks

PHP Coder

  • Expert PHP Helper
  • Senior Member
  • *****
  • Posts: 130
  • Karma: +0/-0
    • View Profile
    • PHP coder
Re: Errors
« Reply #3 on: June 07, 2010, 07:14:02 AM »
Are you using cPanel's File manager? You need to locate this file first:
/home/warranty/public_html/database/processor.php

Then, open it in text editor, and check what is the path to the file config.inc.php at line #7.
PHP coder for hire

Soad

  • New Member
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Errors
« Reply #4 on: June 07, 2010, 08:31:23 AM »
<?php
$file_db=1;

is all that in the config.php file

I have redone a database

http://warrantyregistration-bomag.co.uk/test/form.html

I have a new error

Warning:  mysql_connect() [function.mysql-connect]: Access denied for user 'warranty'@'localhost' (using password: NO) in /home/warranty/public_html/test/processor.php on line 6
  Could not connect to database: Access denied for user 'warranty'@'localhost' (using password: NO)

PHP Coder

  • Expert PHP Helper
  • Senior Member
  • *****
  • Posts: 130
  • Karma: +0/-0
    • View Profile
    • PHP coder
Re: Errors
« Reply #5 on: June 07, 2010, 08:34:31 AM »
I think your config file is corrupted, try to re-upload it again. At least there must be closing php tag  ?>
(but probably also database settings i.e. db name, user name, host, password)
PHP coder for hire

Soad

  • New Member
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Errors
« Reply #6 on: June 07, 2010, 10:17:50 AM »
  •     Hosting company says the following 
     
    You have to  create your database connection string
     
    How do I do that

PHP Coder

  • Expert PHP Helper
  • Senior Member
  • *****
  • Posts: 130
  • Karma: +0/-0
    • View Profile
    • PHP coder
Re: Errors
« Reply #7 on: June 07, 2010, 10:28:48 AM »
You need to check your config file, to make sure it contain correct database info (db name, user name, password and host).
Is this open source script, or custom programming?
PHP coder for hire

Soad

  • New Member
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Errors
« Reply #8 on: June 07, 2010, 12:23:57 PM »
Hi

The form is created with PHP form creator and the database from the cpanel my mysql from my hosting co

Thanks for your help

PHP Coder

  • Expert PHP Helper
  • Senior Member
  • *****
  • Posts: 130
  • Karma: +0/-0
    • View Profile
    • PHP coder
Re: Errors
« Reply #9 on: June 07, 2010, 01:06:19 PM »
So, did you check the content of your config file? Is the database info properly set in this config file?
PHP coder for hire