News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

HTTP 500 Internal Server Error on search...

Started by head123, July 09, 2013, 10:49:19 AM

Previous topic - Next topic

head123

Hi,
M getting HTTP 500 Internal Server Error on searching massage.
I tried to find ERROR LOG for this, No error log was thr.
m not getting reason for this. plz provide ur help.

i m a admin user.


vbgamer45

Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

MrPhil

Could be a lot of reasons to get this error. Start by reading my sig > FAQs > 500 (Internal Server) Errors and see if you can rule out some of the reasons.

head123

 vbgamer45 : getting error on msg search. On Simple search and advance search.

head123

Also i set file permission to 777 to all directories of smf. Location of smf directory is = /usr/local/apache/htdocs/smf . and root user is owner

Storman™

Have you ruled out what MrPhil suggested ?

QuoteCould be a lot of reasons to get this error. Start by reading my sig > FAQs > 500 (Internal Server) Errors and see if you can rule out some of the reasons.

head123

yes, i read that. and now with the help of that, i set the permission to 755 and restarted apache2 service. but :( m getting following error on each page/ any click/ any navigation/ even m not able to log out.

ERROR :attempt to write a readonly database

File: /usr/local/apache/htdocs/smf_setup/Sources/Subs.php
Line: 2624

kat

Quote from: head123 on July 10, 2013, 06:48:05 AMERROR :attempt to write a readonly database

I'd suggest that you want to have a word with your host, about that.

A "Read-only" database isn't much use, for a forum. Ask them to ensure that you have full CHOWN ownership of the files on your site, too.

head123

I debugged this, as per my study : file/directory owner is wrong... need to set CHOWN to same user as "webserver user". I think webserver will not be able to write into files.

Current status : File permissions : 644
                          Folder permissions : 755
All file/folder 's owner is root user.

tell me, Is this wrong setting.
How i set owner user same as "webserver user" ?

kat

Are you self-hosted? (Might've helped, if you'd told us, if you are)

If not, you'll need to contact your host.

Unless you're self-hosted, you can't change CHOWN settings.

head123

Quote from: K@ on July 10, 2013, 06:59:41 AM
Quote from: head123 on July 10, 2013, 06:48:05 AMERROR :attempt to write a readonly database

I'd suggest that you want to have a word with your host, about that.

A "Read-only" database isn't much use, for a forum. Ask them to ensure that you have full CHOWN ownership of the files on your site, too.


It is working before permission / owner change........


head123


head123

:)  resolved : ERROR attempt to write a readonly database. :) By changing the file permission to 777  with owner to daemon user (webserver user)

But, msg search in thronging 500 Internal server error. Rest all the things / search is going well.

File permission 777 is wrong thing, i wanna change it but if decrease permission i faced 'ERROR attempt to write a readonly database'.

now what to do???

kat

Quote from: head123 on July 10, 2013, 07:48:19 AMNo, but i m able to change owner.

You SEEM to be able to change owner. But, in all likelihood, you can't. It'll look like you have, though.

I still think you want to have a chat with your host, myself.

I could be wrong, of course. ;)

MrPhil

Quote from: head123 on July 10, 2013, 07:59:40 AM
:)  resolved : ERROR attempt to write a readonly database. :) By changing the file permission to 777  with owner to daemon user (webserver user)

But, msg search in thronging 500 Internal server error. Rest all the things / search is going well.

File permission 777 is wrong thing, i wanna change it but if decrease permission i faced 'ERROR attempt to write a readonly database'.

First of all, never go blindly changing permissions to 777. They're rarely necessary, and can be a major security problem. Many servers are configured to throw 500 errors when they encounter a "world writable" file or directory (such as 777 permissions). Files should always start out 644 and directories 755. Add "write" to the group (664/775) if SMF complains it can't write to something. Go to 666/777 ONLY if it still can't write, and change it back to 644/755 as soon as you can when you're done with the mod install or whatever you're doing.

What kind of database are you using? Normally you would have no access to the database's files (.myi etc. files), so I don't know what you're doing that gives you "readonly database" errors. We need more information here about your system configuration. When you "decrease permissions", what are you changing file and directory permissions to? 644 and 755? You can try 664 and 775, but that shouldn't have any effect on a database in a normal server configuration.

Kindred

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Storman™


Kindred

yup...   when he kept referncing unwritabel database with regards to file permissions, it almost has to be.

If so -- my best suggestion is to convert to mySQL instead.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

MrPhil

Does SQLite require 664/775 permissions? I hope it doesn't require 666/777. If it does, the rest of SMF can be left at 644/755 or 664/775 -- there's no reason they have to be all the same. It all depends on what PHP is running as (owner, in your group, or as a random "other" user), and likewise for the database system. For SMF, if 666/777 is required for PHP to write, leave only the avatars and attachments directories at that permission, and set everything else to 644/755 until you need to install a mod or do other work, and then temporarily change to 666/777.


Kindred

then I fail to see how changing the file permisssions woudl generate a DATABASE permission error.  That makes no sense at all, unless your host has a VERY screwy set up.

(or maybe you set the actual database files to a bad permission deep in the root of your hosting service?   Although, why you would do that, I have no idea...)
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

head123

Quote from: MrPhil on July 10, 2013, 09:04:08 AM
Quote from: head123 on July 10, 2013, 07:59:40 AM
:)  resolved : ERROR attempt to write a readonly database. :) By changing the file permission to 777  with owner to daemon user (webserver user)

But, msg search in thronging 500 Internal server error. Rest all the things / search is going well.

File permission 777 is wrong thing, i wanna change it but if decrease permission i faced 'ERROR attempt to write a readonly database'.

First of all, never go blindly changing permissions to 777. They're rarely necessary, and can be a major security problem. Many servers are configured to throw 500 errors when they encounter a "world writable" file or directory (such as 777 permissions). Files should always start out 644 and directories 755. Add "write" to the group (664/775) if SMF complains it can't write to something. Go to 666/777 ONLY if it still can't write, and change it back to 644/755 as soon as you can when you're done with the mod install or whatever you're doing.

What kind of database are you using? Normally you would have no access to the database's files (.myi etc. files), so I don't know what you're doing that gives you "readonly database" errors. We need more information here about your system configuration. When you "decrease permissions", what are you changing file and directory permissions to? 644 and 755? You can try 664 and 775, but that shouldn't have any effect on a database in a normal server configuration.

I changed permission as per ur suggestions to 644-file and 755-directory Also 664-filr and 775-directory but got error:  "Database Error. Please try again. If you come back to this error screen, report the error to an administrator"
I am using mySQL.
One question: Does SMF works without any db?  .... Because i was a smf_cd5ccb554f.db file in /usr/local/apache/htdocs/smf/  ..... i couldn't find any db for SMF in mySQL

Kindred

1- you should never, ever, ever touch the database FILES unless you know EXACTLY what you are doing.
2- the database files would not be in the smf directory... they would be int he directory of your root system configured to hold the mySQL database files.
3- No.. SMF *REQUIRES* a database. mySQL is the preferred, but it supports SQLite and PostGRE
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Storman™

I would suggest you nuke the whole instance, get your host to reinstall, and then start again.

It should basically work out the box without any of the errors.

MrPhil

If this is really MySQL, you should have no way to get anywhere near the actual files in the database. They should be well protected from you, and the only way to do anything is through the server interface. Anyway, your error message "Database Error. Please try again. If you come back to this error screen, report the error to an administrator" I think is generated by SMF when it can't connect to the database for some reason. I can't look at my code until tonight to be sure. In the mean time, double check your database connection information in the Settings.php file (DB name, location, user name, user password), and make sure that file is readable (at least 444 permissions).

Oldiesmann

It sounds like you are/were using SQLite, not MySQL. SQLite uses .db files, and would give you the "read-only database" error. MySQL stores data in numerous files (usually one file per database, with additional files handling the indexes, table structure, etc.), and would say something like "Permission denied for user <user>@localhost (using password: YES)" instead.
Michael Eshom
Christian Metal Fans

head123

Now, I am doing setup from first step, before that i clear browser IE history + restarted apache2 and mysql services + deleted old installation directory + copied new one

On the 3rd step of SMF Installer : Database Setting, m getting following error 

==============================================================
Critical Error!
Cannot connect to the database server with the supplied data.
If you are not sure about what to type in, please contact your host.
unable to open database: /usr/local/apache/htdocs/forum/smf_1/smf_1c3d709289.db
==============================================================


On 2nd step : Writable check -
I only provide following details :
host:- localhost, user :-root, password:-(password of root user which is used to access this machine. i.e. login password) , installation path : /usr/local/apache/htdocs/forum/smf_1

Kindred

1- why would you ever use your root account to access the database?
2- from that installation message, it would appear that you are indeed trying to use SQLite.   Why?
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

head123

1. only for full access.
2. SQLite / mySQL both are ok for me. no database specification, just wanna up the forum with its msg searching feature...

Storman™

Quoteonly for full access.

Not quite sure what you mean by that?

If you are using your root account in Settings.php to access the databse then potentially that puts the whole instance at risk should it get compromised.

QuoteSQLite / mySQL both are ok for me

Then use mySQL as SQLite is obviously giving you issues  ;)


head123

Can not select Database (MySQL).........

Hi, i am doing fresh smf installation, i found that installation not asking me for selection of database. Here are the screen shot. please check it.
And on the 3rd step i got Critical Error : unable to open database /usr/local/apache/htdocs/smf/smf_6be6604b0d.db


Before installation-- i removed old smf setup directory + deleted browser hostory   

Illori

please keep to one topic, your other thread has been locked.

if you are using a .db file you are using sqlite and it is recommended you look into using mysql instead.

Kindred

yep...   see that line that says "database filename"?
That is for SQLite.

mySQL doe snot have you define a database filename....
it asks for database name, database host, database username and password
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

head123

ok. I provided user and password of FTP. For SQLite what should i suppose to provided / or what should i suppose to do ?

head123

Do i need to install SQLite on this machine??    (MySQL is already installed.)


Kindred

the username and password for FTP is **DIFFERENT** from the database user and database password.

I don't know what choices you have made to get to that point, but you have obviously told it to use SQLite, for some reason and in some way.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

head123

So, in this case its good to proceed with SQLite. m i Right ?
If Yes, what should be next step?

Illori

no it is not good to proceed with sqlite, it has issues and restrictions. mysql is a much better option.

head123


head123

On 2nd step of installation : Writable Check :
I put username/pass : root/****   (with this password i can connect to mysql )

I got error : Unable to connect to FTP server with this combination of details.
530 Login incorrect

head123


Storman™

Yes, never use root.

And make sure you also give that user suitable MySQL permissions otherwise you'll still have the same problem.

http://dev.mysql.com/doc/refman/5.1/en/adding-users.html

If you used a control panel like cPanel then this is dead easy to do. Something like a control panel may be beneficial for you.

head123


m using machine :-Ubuntu 10.04.4
So, i executed following commands--
1. mysql -u root -p****
2. CREATE DATABASE smf_database ;
3. GRANT ALL ON smf_database.* TO smf_user@localhost IDENTIFIED BY '****';
4. logout
5. mysql -u smf_user -p****
6. show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| smf_database       |
+--------------------+
2 rows in set (0.00 sec)
-----------------------------------------------------

head123

Still the error same : Unable to connect to FTP server with this combination of details.

530 Login incorrect


on step 2: I provided new created mySQL user name and password.  :(

Storman™

Off topic but any reason why you are using an older version of Ubuntu, it's "End of Life" date was back in May 2013.:

https://lists.ubuntu.com/archives/ubuntu-announce/2013-March/000169.html

Problem here is that this isn't really an SMF issue, it's becoming more to do with setting up your server so that it works correctly. That makes me wonder about other services on the instance and whether they are set-up correctly, or even installed and running.

Illori

no you have asked already and we told you not to use sqlite.

MrPhil

If MySQL (version 5) is available, you'll find it much easier to use than SQLite. If it's not available, you'll just have to soldier on with SQLite, though it's not the optimal choice.

I'm concerned about your platform. Is this a PC running a LAMPP stack, or a real honest-to-goodness professionally run server? If it's a PC, don't use it for a server connected to the Internet, or you will be hacked and pwned so fast you won't know what hit you. Especially, if it's a home-brew aggregation of this and that, rather than a proper LAMPP stack installation. I guarantee that the hackers will know more about your security (or lack of it) than you or whoever is running this "server". If it's isolated from the Internet, you might be safe, but should still be using a LAMPP stack to ensure that everything works together.

head123

Yes, PC running LAMP stack. And this forum will be available in LAN only,  isolated  from internet.

My problems are :
1. installation not asking for MySQL or SQLite selection (Please refer above screen shots )

2. If I proceed to next installation step and provide username and password of MySQL user >>
            ERROR : Unable to connect to FTP server with this combination of details.530 Login incorrect

3. If I provide username and password of FTP user >>  Then installation proceed to next step "Database setting" >>
    - It asks for database filename :-
          a. string "/usr/local/apache/htdocs/forum/smf_bd5880ebd0.db" is already typed in the database filename textbox  >> so i kept that and click 'continue' >>
             Critical Error! Cannot connect to the database server with the supplied data. If you are not sure about what to type in, please contact your host.
             unable to open database: /usr/local/apache/htdocs/forum/smf_bd5880ebd0.db
       
          b. on retry I provided database filename :- Name od MySQL database which i created.
              Critical Error! Cannot connect to the database server with the supplied data. If you are not sure about what to type in, please contact your host.
             unable to open database: /usr/local/apache/htdocs/forum/smf_database.db

           

Illori

then it sounds like you dont know how to configure your server correctly, which is beyond the support we provide here.

head123

Quote from: MrPhil on July 17, 2013, 10:25:08 AM
If MySQL (version 5) is available, you'll find it much easier to use than SQLite. If it's not available, you'll just have to soldier on with SQLite, though it's not the optimal choice.

I'm concerned about your platform. Is this a PC running a LAMPP stack, or a real honest-to-goodness professionally run server? If it's a PC, don't use it for a server connected to the Internet, or you will be hacked and pwned so fast you won't know what hit you. Especially, if it's a home-brew aggregation of this and that, rather than a proper LAMPP stack installation. I guarantee that the hackers will know more about your security (or lack of it) than you or whoever is running this "server". If it's isolated from the Internet, you might be safe, but should still be using a LAMPP stack to ensure that everything works together.

Yes, PC running LAMP stack. And this forum will be available in LAN only,  isolated  from internet.

head123

Quote from: Illori on July 18, 2013, 05:17:32 AM
then it sounds like you dont know how to configure your server correctly, which is beyond the support we provide here.

:( yes, m not good in configure server things.... also my machine showing me errror and error  for my all alternative tries.
I really really need ur support ...

Illori

we dont provide support here on configuring servers from scratch, sorry.

MrPhil

If it really has a LAMPP (or LAMP) stack installed, the "M" is for MySQL. It sounds like a totally botched installation and/or configuration. Are you really required to use SQLite for the forum, or does someone need it for another project? AFAIK MySQL and SQLite can coexist on a machine, so you can go ahead and use MySQL for SMF -- does anyone have contrary information?

head123

Quote from: MrPhil on July 18, 2013, 09:15:33 AM
If it really has a LAMPP (or LAMP) stack installed, the "M" is for MySQL. It sounds like a totally botched installation and/or configuration. Are you really required to use SQLite for the forum, or does someone need it for another project? AFAIK MySQL and SQLite can coexist on a machine, so you can go ahead and use MySQL for SMF -- does anyone have contrary information?

No I dont required  to use SQLite for the forum, no one need it for another project.
I want to use MySQL  for SMF.
But facing errors. and want support to resolve the errors

head123

A very first problem is SMF installer is not asking for "Database Type" ... Please refer screen shot

Kindred

you are missing our point.

Some misconfiguration of your server is not allowing SMF to recognize that databases exist....

When I install my system asks me...
(see attached)
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

head123

hi,
yes m also agree with u all, my system is mis-configured.
just for my more understanding i open install.php of SMF. i found for each installation step thr is one function :-
1. function Welcome (Line no :- 401)
2. function checkFileWritable (Line no :- 478)
3. function databaseSetting (Line no :- 675)
      --- In this I saw db_type variable has value 'sqlite'    (Line no :- 723 and 768)

Please explain me how sqlite is thr ? how variable db_type take this value ? thr is No sqlite is installed on my machine ?
(Is because of this installer not asking me for database type selection ?? )

please refer attached install.php

Advertisement: