PDA

View Full Version : PHP Connect


jpinches
6th of June 2003 (Fri), 14:40
Hi,

I am relatively inexperienced with web site creation and MySQl. I signed up with a web provider that runs Linux Redhat, PHP and MySQL with versions that meet the requirements.

I ran setup from the a root directory and everything seemed fine. Message at bottom confirmed Okay. Then I edited the Connect.PHP file and executed to find message "can not connect with database, etc."

I e-mailed tech support with the header of the connect file and they recommended removing the $ charactors as the server would not work with it. Tried executing after editing and still same problem. Checked all permissions for execute privledges and all are okay.

I moved the EE folder under the public directory to see if that was the problem. No success. Seems like everything I try results in the same error message.

Pekka has done a fine job with the EE script program and I drool seeing his sample gallery and other's sites who have managed to get it working. I have years worth of digital photos to organize in the way EE allows one to.

Can anyone be of assistance to me? I would really appreciate someone helping debug my problem to get this up and running! Fixing the problem may help other's who may run into same problem.

Thanks!

Pekka
6th of June 2003 (Fri), 15:22
What puzzles me is that if your setup.php ran without errors, then your connect.php was already setup correctly!

Ok, start with original connect.php. Open it into notepad (or pico in unix) and touch only these lines:

$servername = "DB_SERVERNAME_HERE";
$databasename = "DATABASENAME_HERE";
$username = "DB_USERNAME_HERE";
$password = "DB_PASSWORD_HERE";

You should replace items in uppercase letters with you own personal data.

Servername is usually "localhost".

Databasename, username and password you get from your server provider. Usually they send you a mail when you buy server space, that first mail has the passwords.

So edited connect info would look like e.g.

$servername = "localhost";
$databasename = "db1";
$username = "jpinches";
$password = "mostsecretsqlpass";

jpinches
6th of June 2003 (Fri), 16:49
Thank you so much Pekka!

After I contacted the tech support people after running setup and then incurring the connect error, they said to delete the MYSQL database and create a new database per their exact instructions. This I did verbatim. However, experience told me that I should create a new name for the new database after deleting the old. This so there would be no remnents of the old name.

So the question is then, since I installed a new database after executing setup, do I need to reinstall EE again? And if so, do I need to delete the folder and reup a fresh copy?

Your header edits are very helpfull. The tech people told me to edit the path below the header where all variables are on one line. So they sent me in the wrong direction. I think with the answer to the two questions above, I will have EE up at last!

Thanks again for writing such a valuable script engine. I have searched the web for hours and have not found a better solution for posting galleries! Jalbum is good, but no indexing and search capabilities like your program has! Great job! I will for sure make a donation toward your effort when I get it running.

Pekka
6th of June 2003 (Fri), 18:23
EE 1.22 setup gives you an option to remove old EE tables from database when it detects and old installation, this is equivalent of "clean install" and it will overwrite your existing EE database.

If you are unable to clean the database from EE tables using setup try PHPmyadmin tool http://www.phpmyadmin.net (usually comes with virtual server packages, again check you server company mails).

Then some technical explanations:

The databases in SQL work so that you can have any number of them for one user (depends on server company how many) but for EE you need only one.

Each database has tables. All EE's tables are prefixed "ee_" so you can use same database for several applications. However I do not recommend this because in most server you can not edit MySQL settings to make this work with good speed ( needs more RAM to table cache).

(A friendly reminder: Do no edit the "ee_" tables with any third party software when gallery is set up and running. It is very complex in relations and e.g. deleting one single row for a table will make the whole gallery dead. I can fix those if you do that but: don't. Use only EE's editor tools to edit the database.)

Then there are EE program files. They do not contain ANY info about your gallery, so they are not 'valuable' per se. They are not changed in any way when program is run, but the database is changed constantly. That is why it is important to back up the database from time to time (EE 1.3 has a tool for that, see below).

PS. I recommend you upgrade to EE 1.3RC http://photography-on-the.net/forum/showthread.php?t=5552#45418 as soon as you have 1.22 up, and after that get "EE Backup update for MySQL 4.0" from http://photography-on-the.net/forum/showthread.php?t=9812

Soon there will be EE 1.5 with uploads and other nice stuff. I'll release a beta quite soon.

jpinches
6th of June 2003 (Fri), 23:22
Thank you! I will get into this as soon as time comes available. I am most anxious to use EE.