PDA

View Full Version : What am I missing?


Joanne
4-11-02, 10:17 PM
I'm in the process of learning php and mySQL. I was able to successfully install phpMyAdmin and connect to my database. I also played around with some other scripts so far so good.

Now I trying to get a shopping cart script going with no luck. I have the path to php on the top, everything chmoded but I still get Error 500. The error log entry is:

Premature end of script headers: /www/w/website/htdocs/shopping/storeAdminMenu.php
failed to open log file
fopen: Permission denied

Do I need to watch out for something when the php file writes the html part?
Like in:

#!/usr/local/bin/php

<?

print("<html>\n");
print("<head>\n");
print("<title>Store Admin</title>\n");
print("</head>\n");

Some doctype header maybe?

Thanks,

Joanne

-------------
Object Tools, Inc. (http://www.objtools.com)

sophiespo
4-11-02, 11:20 PM
make sure the directory containing the script is chmodded to 755 as well.. some scripts make you set it to 777 or something else, but it wont work that way.

The error youre getting is usually a permissions or upload format error. You did upload in ascii, right?

sophie

Tresclub
4-12-02, 04:21 AM
...I was able to successfully install phpMyAdmin and connect to my database.
Joanne, So glad to hear you were able to get phpMyAdmin installed. If you don't mind,
I would like to pick your brain as to your installation process.

I have all the files uploaded to my PowWeb server. When I launch the index.php file,
I get the window with two frames; however, I, too, am getting the infernal
500 INTERNAL SERVER ERROR.

I know that the line #!/usr/local/bin/php needs to be inserted at the top of the php file.
What I am asking you is this: to how many files, and to which files, did you add this line.
If you could tell me that much, it would save me an enourmous amount of time.

Your help will be greatly appreciated. Thanks!

Warren Peters
tresclub.com

sophiespo
4-12-02, 04:35 AM
i have it added to these files and its all working:

tbl_select.php
tbl_replace.php
tbl_rename.php
tbl_que.php
tbl_properties.php
tbl_move_copy.php
tbl_dump.php
tbl_create.php
tbl_change.php
sql.php
read_dump.php
main.php
left.php
index.php
db_printview.php
db_details.php

there are probably a few more that need it, but for most actions you'll need the line added to the above files. Remember, all these files need to be chmodded to 755 also.

sophie

Joanne
4-12-02, 09:45 AM
I experimented so much, that I hardly remember what finally did the trick. :) But one thing I learned is that I have to chmod all php files in all subdirectories to 755 before anything worked.

I also added (for good measure) the php path to all files in the main myphpAdmin directory. At that time I didn't know that you need it only in files that are called directly by the browser. It doesn't hurt anyway. If you see the line in your browser, you know that you added it in a file that is an "include" file. The program, however, will still work.

Check you config setting, too. Here are mine for comparison.

$cfgServers[1]['host'] = 'xxxxx.powweb.com'; // mine is 'neptune.powweb.com'
$cfgServers[1]['port'] = '3306';
$cfgServers[1]['socket'] = '';
$cfgServers[1]['connect_type'] = 'tcp';
$cfgServers[1]'controluser'] ='';
$cfgServers[1]['controlpass'] '';
$cfgServers[1]['auth_type'] = 'config';
$cfgServers[1]['user'] = 'data_base_user'; // the user name you chose for your database
$cfgServers[1]['password'] = 'data_base_password'; // the password you chose at set-up time
$cfgServers[1]['only_db'] = 'database_name'; // the database name you chose at set-up time with Powweb

Let me know if it helped,

Joanne

---------------------

Object Tools, Inc. (http://www.objtools.com)

Joanne
4-12-02, 09:52 AM
thanks, Sophie, for your reply, but it doesn't solve my problem. the directory is chmoded 755 and all php files within it, too.

Any other idea? I'm at a total loss. The only dirfference I see between files that work and this one is that the html part and php part are not seperated. Maybe I have to experiment in this direction some more. If anyone can help me save some time, it would greatly appreciated.

---------------------------
Joanne

Object Tools, Inc. (http://www.objtools.com)

Tresclub
4-12-02, 01:46 PM
Thanks so much to both of you for your replies.
Will be getting back in to this later this afternoon,
and will let you know how I make out.

Again, Thanks Very Much!

Tresclub
4-15-02, 03:16 AM
Yes!!! It appears to be working fine!!!

Now, all I have to do is learn how to "use" it. :)

Two questions:

How do I backup my XMB forum?
Last week something happened to my Forum, and I lost everything.
Had to do a complete re-install and rebuild all the forums.
and...
How do I password protect my phpMyAdmin folder on the server?
I don't want anyone else to have access to this folder, and it's sub-folders.
My Forum (http://www.tresclub.com/forum/index.php)

sophiespo
4-15-02, 05:39 AM
To password protect your phpMyAdmin directory, do a search on this forum for ezpass or lockit. They are two really good scripts to help you with it.

As for the backing up of your forum, unless you have an option in the admin control panel of it, I would just go into phpMyAdmin and save all the XMB tables. MAKE SURE when you save them, though, that you check the box that says "Structure AND Data" otherwise it will just save the table structures and not any of the data contained in them. They will all be saved as .sql files and if you need to use them you just dump them back into your database. Id suggest to do backups frequently so that you wont lose many posts/user information if something happens.

sophie

Tresclub
4-15-02, 04:43 PM
To password protect your phpMyAdmin directory, do a search on this forum for ezpass or lockit. They are two really good scripts to help you with it.

What is your recommendation... does the phpMyAdmin folder really need to be password protected?

...As for the backing up of your forum...

Could I just create a [phpBackup] folder on my server, and copy all those files to it? If I ever needed to do a "restore", I could just copy the files back.

sophiespo
4-15-02, 07:16 PM
phpMyAdmin DEFINITELY needs to be password protected...!!!!! If it isnt, ANYONE could get to it, and change your database.

To backup your forum messages and user information youd have to backup the database tables.. thats where all this information is stored. To backup the way the forum looks, etc you would copy the files to a different place. In my opinion, its the messages and the user information that you should be most concerned about.

sophie

ffejy
4-15-02, 07:44 PM
How exactly do you back up database tables? I have not done very much with MySQL, but I was just wondering how you do this.

Thanks!

Jeff

sophiespo
4-15-02, 07:50 PM
Id advise to use phpMyAdmin for this. Click on the table name in the left frame that you want to backup. Scroll down the right frame until you see some options. There should be one saying "View dump (schema)" Click on the structure AND data option.. also check the radio box that says save as file. then click go.

sophie

Tresclub
4-15-02, 09:24 PM
To backup your forum messages and user information youd have to backup the database tables..

Soph..., Where is this info? What files?

Warren

sophiespo
4-15-02, 11:43 PM
you have phpMyAdmin installed, right? Go into it, and in the left frame look for tables that are prefixed with XMB_ or forum_ or something to that effect. Or, try reading the readme for your forum and see if it lists what the tables were named. Anyway once you find out which tables they are, just save them to a file on a regular basis.

Im sorry I cant tell you what the tables would be called, I havent used xmb.. if you PM me the url to your phpMyAdmin with a username & password (if youve protected it) and Ill have a look and see if I can find the tables for you.

sophie

Tresclub
4-16-02, 04:14 AM
I just installed password protection for my 'phpMyAdmin' folder.
The installation was a piece of cake because of fcsnc and Tubba.

fcsnc... For this invaluable link:
The EZPass script (http://www.croesusdesign.com/pass.html) I passed on to you is one way to do this. I don't know of a simpler way.

Tubba... For this invaluable tip:
As well as the .htpasswd, you need a .htaccess in whatever you want to protect.

I got the ezpass.cgi file created and uploaded to my cgi-bin folder. Called the file, and got the two .ht files created, and uploaded to my 'secret' folder. Tried to access my phpMyAdmin file, but got the 500 INTERNAL SERVER ERROR because I had forgot to delete the '-T' from the #!/usr/local/bin/php line that I copied/pasted from the EZ-Pass website. Tried it again, but this time the page wasn't found, because I had not uploaded the two files to the folder I wanted protected.

Thanks to both of them for these great suggestions!

Tresclub
4-23-02, 07:12 PM
Originally posted by sophiespo
Id advise to use phpMyAdmin for this. Click on the table name in the left frame that you want to backup. Scroll down the right frame until you see some options. There should be one saying "View dump (schema)" Click on the structure AND data option.. also check the radio box that says save as file. then click go.

sophie

Got 'em all "saved to file" in a seperate folder outside my forum folder.
Next question: In the event I need to recall any, or all, of them, where is that option?
Looked all over, didn't see anything that jumped out at me?

btw... Thanks for all your help Sophie!!!

sophiespo
4-23-02, 07:43 PM
When you want to put your saved tables back into the database, this is what youll need to do.

1) if the table still exists in the database and you want to write over it, youll probably have to drop (delete) the table first or youll get errors saying that the table already exists. So, click on the tablename you want to drop, and click the drop link.

2) Click on the name of your database in the left frame. Scroll down in the right frame until you get underneath the list of tables. Underneath the list will be an option saying " Run SQL query/queries on database.." with a textfield. You want the bit underneath that that says "Or Location of the textfile :" click on the browse button, choose the .sql file youve saved and click Go. Done! :)

Im really glad youre getting it all going

sophie

Tresclub
4-24-02, 01:40 PM
Thanks again Sophie!