Access denied for user 'wwwrun'@'localhost' (using password:

All about webserver configurations, PHP and databases.

Moderator: Thorsten

brainray
Posts: 10
Joined: Sun Mar 09, 2008 12:13 am

Post by brainray » Mon Mar 10, 2008 11:10 pm

Hi,

hmmm, nobody has a hint? Am I just overlooking something obvious?

Thanks

Ray

Thorsten
Posts: 14774
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten » Tue Mar 11, 2008 8:00 am

Hi,

the problem is that your PHP configuration is really a bit strange because the installer creates the correct data.php file with the correct values but the script doesn't use that...

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist

brainray
Posts: 10
Joined: Sun Mar 09, 2008 12:13 am

Post by brainray » Tue Mar 11, 2008 11:34 am

Hi,

okay, I was just able to install version 1.6.12 and it works. It seems that all of the 2.x version won't run here.

If you have an idea what I could try to get it working with 2.0 let me know.

Best

Ray

matteo
Posts: 572
Joined: Sun Nov 20, 2005 6:53 pm
Location: Italy

Post by matteo » Sat May 10, 2008 8:46 am

Hi,
brainray wrote:I also got the same error message while installing, then set the permissions for inc/data.php to 755. Where should I go now?
Open the inc/data.php text file and check if the credentials and coordinates of your database are those you've inserted in the install stage: maybe the password you typed in doesn't match with what written by the installer page into the config file. IF the data match THEN you could use this approach to be sure that you're using the right credentials AND you can connect to the database before trying any new PMF install attempt.

Ciao,
Matteo
phpMyFAQ QA / Developer
Amazon.co.uk Wishlist

ZarPrime
Posts: 19
Joined: Sun Nov 16, 2008 10:49 pm
Contact:

Post by ZarPrime » Wed Nov 19, 2008 8:35 pm

In my case there was no data.php file in the zip file I downloaded. When I run the installation script, I get the following message (Server name changed to protect the innocent <g>) ...
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'faq1'@'localhost' (using password: YES) in /home/XXXXXXXX/public_html/faq/inc/PMF_DB/Mysql.php on line 67

I have chmod'ed the inc/ folder to 777 and after I received this result I chmod'ed the Mysql.php file to 777 as well and tried running it again with the same result. After running the script again I get the same result. The data.php file was never created. I only still have the file "data.php.original".

Once the installer ran part way, it created the attachments/, data/, pdf/, and xml/ folders correctly. However, because these folders weren't uploaded by me, but were created by the script instead, the owner is listed as "99" instead of my server name. For some reason, this keeps me from being able to chmod them to anything higher than 755. Just more frustraion.

I worked Sunday on trying to get this installed for about 6 or 7 hours without success. I'm getting somewhat frustrated. I've never had this many problems trying to install something on my server, whether it be a forum or anything else.

Anybody know what I'm doing wrong?

ZarPrime

jenolan
Posts: 16
Joined: Fri Apr 13, 2007 12:54 pm

Post by jenolan » Wed Nov 19, 2008 10:55 pm

Line 562 in install/installer.php remove the following code...

Code: Select all

    // check database connection
    require_once(PMF_ROOT_DIR."/inc/Db.php");
    $db = PMF_Db::db_select($sql_type);
    $db->connect($sql_server, $sql_user, $sql_passwort, $sql_db);
    if (!$db) {
        print "<p class=\"error\"><strong>DB Error:</strong> ".$db->error()."</p>\n";
        HTMLFooter();
        die();
    }
I think that is the one, been a while. There are two connects in the code one causes the problem the other (just in case) is at line 691 but I am pretty sure it was the first one that caused the problems.

Larry

ZarPrime
Posts: 19
Joined: Sun Nov 16, 2008 10:49 pm
Contact:

Post by ZarPrime » Thu Nov 20, 2008 12:51 pm

OK, I'll try removing thos lines and see if that lets me install it. If not, I'll be back. :wink:

thanks for the quick response.

ZP

ZarPrime
Posts: 19
Joined: Sun Nov 16, 2008 10:49 pm
Contact:

Post by ZarPrime » Sun Nov 23, 2008 11:53 pm

Well, I removed that code and tried the install again. Same result.

I really wanted to install this on my server. I guess some things are not just meant to be. If anybody can think of anything else, I'm all ears, but's it's beginning to look like I'm not going to be able to get this installed properly.

Please help if you can.

ZarPrime

ZarPrime
Posts: 19
Joined: Sun Nov 16, 2008 10:49 pm
Contact:

Post by ZarPrime » Mon Nov 24, 2008 12:35 am

I decided to go ahead and delete my entire faq folder and start over. Trying to delete the whole thing in both an FTP client and CPanel File Manager failed because of the folders that the installer script made during the install process. It tells me I can't delete them because I'm not the owner.

This is getting more and more frustrating. I could really use some help in getting this thing installed if anybody in charge here is interested in helping. If not, then I'll just have to do without it.

Thorsten
Posts: 14774
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten » Mon Nov 24, 2008 7:52 am

Hi,

your problems are really strange. What you can do is trying an "manual" install. If you like I could provide you some help with that.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist

ZarPrime
Posts: 19
Joined: Sun Nov 16, 2008 10:49 pm
Contact:

Post by ZarPrime » Mon Nov 24, 2008 9:09 pm

Thorsten wrote:Hi,

your problems are really strange. What you can do is trying an "manual" install. If you like I could provide you some help with that.

bye
Thorsten
I actually thought I was doing a manual install. I created the database., setup the user, and uploaded all the files via FTP, and then ran the installer script, just as it says to do in the docs. I was going to ask my host to delete the whole www/faq/ folder since I can't seem to delete .../faq/attchments, .../faq/data, .../faq/images, .../faq/pdf, and .../faq/xml. then I was going to delete the database I created and totally start over.

How do you actually do a manual install? I don't see anything in the docs about that?

ZarPrime

ZarPrime
Posts: 19
Joined: Sun Nov 16, 2008 10:49 pm
Contact:

Post by ZarPrime » Tue Nov 25, 2008 6:04 am

While I am waiting an answer from Thorsten about how to do a manual install in my message earlier, I thought I would mention something else and a request.

In the docs, it says that a file and 5 directories shown below should have permissions set to 777. Because of the problems I have been having getting the install script to work properly, I was going to delete my entire /faq/ folder and start over. I couldn't change these permissions because the phpMyFAQ application owns those folders in my installation.

I mentioned that certain files/folders need to have permissions set to 777 per the following info from the docs ...

It might help to set chmod 777 to the whole phpMyFAQ directory to avoid problems during the installation. If you're running a very restrictive mod_php installation you should keep the chmod 777 for the following files and directories even after the succesful installation:

* the file data.php in the directory inc/
* the directory attachments/
* the directory data/
* the directory images/
* the directory pdf/
* the directory xml/

However, as I said, I couldn't chmod these files/directories because the installation script creates these files and directories and, as the owner, the application must chmod these because I am not able to do it.

My Request ...

Is there any way, in the next version of PHPMyFAQ, that all these permissions could be set properly by the application since the application, as the owner, is the only one that can make these chmod changes?


I deleted everything in my /faq/ folder except for the folders listed below. I sent a support ticket to my host and they did a chown on that folder and everything below it so that I could make these chmod changes. At this point, the only things left in the folder are ...

* the directory attachments/ - (contains an index.html file)
* the directory data/ - (contains an index.html file)
* the directory images/
* the directory images/image/ - (contains an index.html file)
* the directory pdf/ - (contains an index.html file)
* the directory xml/ - (contains an index.html file)

All the folders that are left are now owned by me now instead of the application, so I can chmod them all now and delete them if I want to, so that I can start over. However, at this point, I'm going to wait to hear back from Thorsten about the manual install since I may just be able to copy everything back in now.

The messages between my host and me are shown below. I hope this explains this problem properly.

ZarPrime

From ---> Support
PHP files and folders created specifically by the php application are owned by the php user nobody. You cannot alter these files/folders unless they are set to 777 by the application or unless we change the ownership (chown) them to your username. I have changed the faq directory and everything below it to your ownership. You can now change permissions on anyting and/or delete the entire thing, if you really want to start over.

We don't use LDAP, so you can ignore that portion.

To ---> Support
Thank you for doing this. I don't know if this is possible, but I am going to suggest that the author of the application fix this so that the owner of the site running his application can make these changes in the future to avoid these problems. I really don't know how they expect me to chmod these folders they mention to 777 if they are set as the owner and the script doesn't chmod those folders to 777 as they suggest that I need to do. It has been a real pain for me to try to get this installed properly and I'm pretty good with stuff like this.

Again, thanks for your help.

From ---> Support
You can suggest it, but the ownership issue is pretty standard behavior for php-based applications that are running on servers where phpsuexec or suphp is not compiled. A better option would be for the application itself to create the permissions (rather than trying to change the ownership) for items it creates that are, or should be, user-modifiable (or create something in the app where the app itself is utilized to modify items, since the application would have access to modify the files).

--
Regards,

Annette

To ---> Support
Ah, I see. OK, well, your solution is much better than I thought. I will ask the author if this can be done. There doesn't seem to be any particular reason why the application shouldn't setup the permissions properly when the application is first installed.

Thanks so much for the help. I think this answers all my questions.

Thorsten
Posts: 14774
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten » Tue Nov 25, 2008 9:54 am

Hi,

you can change the chmod to 777 if you edit the file install/installer.php at line 331 from

Code: Select all

if (!@mkdir (PMF_ROOT_DIR.$dir, 0755)) {
to

Code: Select all

if (!@mkdir (PMF_ROOT_DIR.$dir, 0777)) {
Normally 755 is enough...

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist

ZarPrime
Posts: 19
Joined: Sun Nov 16, 2008 10:49 pm
Contact:

Post by ZarPrime » Tue Nov 25, 2008 3:34 pm

OK, well, I can try this, but is there a document somewhere on how to do a manual install. You mentioned doing a manual install a couple of messages up.

Thanks,
ZP

Thorsten
Posts: 14774
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten » Tue Nov 25, 2008 4:14 pm

Hi,

there's no document for a manual install. I would write it.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist

Post Reply