PHP Issue

I just setup a php site located at www.modlowarvai.com which you can see many errors, anyone know how to fix them. i believe it is the basepath isn’t setup correctly

The Errors
Warning: include(/home5/thecopyz/public_html.modlowarvai/lib/db.class.php) [function.include]: failed to open stream: No such file or directory in /home5/thecopyz/public_html/modlowarvai/functions.php on line 96

Warning: include() [function.include]: Failed opening ‘/home5/thecopyz/public_html.modlowarvai/lib/db.class.php’ for inclusion (include_path=’.:/usr/lib64/php:/usr/lib/php’) in /home5/thecopyz/public_html/modlowarvai/functions.php on line 96

Warning: include(/home5/thecopyz/public_html.modlowarvai/lib/users.class.php) [function.include]: failed to open stream: No such file or directory in /home5/thecopyz/public_html/modlowarvai/functions.php on line 97

Warning: include() [function.include]: Failed opening ‘/home5/thecopyz/public_html.modlowarvai/lib/users.class.php’ for inclusion (include_path=’.:/usr/lib64/php:/usr/lib/php’) in /home5/thecopyz/public_html/modlowarvai/functions.php on line 97

The Code
I believe this is the area that the code is wrong as i need to set the base path and not sure what it would be

$dbServer = “mysql”;
$dbHostname = “localhost”;
$dbUsername = “thecopyz_ZincLan”;
$dbPassword = “removed”;
$dbName = “thecopyz_ZincLance”;

$site_url = “http://www.modlowarvai.com”;
$base_path = “/home/demon/listing/”;
$theme_path = $base_path . “themes/”;
$admin_template_path = $base_path . “admin/a_themes/”;

$site_name = “Modlowarvai Directory”;

$active_theme = ‘theme1’;

ok, fixed the first issues by adding a link for base url and now have these issues

Warning: mysql_connect() [function.mysql-connect]: Access denied for user ‘thecopyz_ZincLan’@‘localhost’ (using password: YES) in /home5/thecopyz/public_html/modlowarvai/lib/db.class.php on line 20

Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /home5/thecopyz/public_html/modlowarvai/lib/db.class.php on line 22

Warning: Cannot modify header information - headers already sent by (output started at /home5/thecopyz/public_html/modlowarvai/lib/db.class.php:20) in /home5/thecopyz/public_html/modlowarvai/filters/filter.gzip_compression.php on line 28

Warning: mysql_connect() [function.mysql-connect]: Access denied for user ‘thecopyz_ZincLan’@‘localhost’ (using password: YES) in /home5/thecopyz/public_html/modlowarvai/lib/db.class.php on line 20

Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /home5/thecopyz/public_html/modlowarvai/lib/db.class.php on line 22

Fatal error: Call to a member function RecordCount() on a non-object in /home5/thecopyz/public_html/modlowarvai/lib/db.class.php on line 328

Well, since you only showed variables and no code, we can only guess!

But, you can not use LOCALHOST on a website. When you create a connection to a database, you tell it where the database is, give it the user name and password. Then, you tell it which database to use and the table you want to pull data from. You have not made a valid connection.

When you have a database system install on your local machine and it is running, you use LOCALHOST to access the “local” database system. The URL paths you put in place have nothing to do with the error you are getting. It is the connection to the location of the database. I some hosting companies, it is just the address of the site such as “www.modlowarvai.com”. In others, it is a more complicated name like “systemresources.20342.access.234.domains.net”. Or some other crazy name. You would know this when you set up your database in the first place.

Hope all that helps… Good luck!

weird, all of my other sites have local host and i host on hostmonster which work fine, the original code i posted is the code for the database that i used, not sure what other code i need to show as i am not sure

config
===================================================*/

$dbServer = “mysql”;
$dbHostname = “localhost”;
$dbUsername = “thecopyz_ZincLan”;
$dbPassword = “password removed”;
$dbName = “thecopyz_ZincLance”;

$site_url = “http://www.modlowarvai.com”;
$base_path = “/home5/thecopyz/public_html/modlowarvai/”;
$theme_path = $base_path . “themes/”;
$admin_template_path = $base_path . “admin/a_themes/”;

$site_name = “Modlowarvai Directory”;

$active_theme = ‘theme1’;

$email_address = "ModlowArvai Directory ";

$spam_proof = 1;
$enable_user_validation = 1;

$allowed_file_extension = “gif,jpg,png,pdf,zip,doc”;
$google_key = “”;
$whosonline = “600”;
$reciprocal_check = 0;
$urlcheck_limit = 1; // days for re-check url
$pagerank_cache = 30; // days for caching pagerank

$max_image_width = 1024; // in pixel
$max_image_height = 756; // in pixel
$max_file_size = 500; // in KB

$only_registered_can_add_link = 0;
$only_registered_can_add_review = 0;
$db_use_persistent = 0;

$paid_link_day_period = “30,60,90,180”;
$paid_link_price_factor = “1,1.5,2,3”;

$enable_html_tag = 1;
$allowed_html_tag = “,,,,,

,,
    ,
    ,
  • ”;

$enable_page_compression = 1;

Well, again, you did not show any PHP connection code in your post.

I will assume you are not clear on PHP connections to MySQL databases. Your hosting company has several ways to access your database. One is a LOCAL connection, but, that is not for public webpages, it is for testing locally thru them login system. Here is a page on their site that explains the main three ways to connect. On a public page (general website) you will have to set up a connection which will include your domain address not localhost. Hope this link helps you…

https://my.hostmonster.com/cgi/help/137

Good luck…

Whether or not he can use localhost all depends on how the host has their software configured. I use localhost on my host when i create a connection. So that’s most likely correct, he just needs to check the login information.

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'thecopyz_ZincLan'@'localhost' (using password: YES) in /home5/thecopyz/public_html/modlowarvai/lib/db.class.php on line 20

This means that the proper username/password is not working to connect to the database.
localhost should work fine, but you can also try putting in the IP Address to work as well.
Make sure that you have created the username thecopyz_ZincLan with the proper password.
And also ensure that you have added the user thecopyz_ZincLan to the database.

im sure you already know that you have to create a username/password and assign it to the database, if ZincLan is your cpanel username it probably wont work

yes, i have installed scripts many times and created databases, imported the tables and such

this is my database and user that is attached, i can try and change the pass to a new one
thecopyz_ZincLance user-thecopyz_ZincLan

Looks like you got it.

yes Jm, thanks. i deleted the users and database and recreated them and it worked great

Sponsor our Newsletter | Privacy Policy | Terms of Service