Forum

Thread tagged as: Problem, Installation, Configuration

trying to setup perch site locally

I'm getting the following message in my stage 1 of set up:

"Configuration file is missing or PHP does not have permission to write to it. Make /Users/apple/Sites/firstunitarianottawa/1uo_admin/config/config.php writable."

Using MAMP and macbook pro and firefox browser. I don't see a problem with permissions of the config.php file (which is empty) so, not really sure how to go from here.

ruth tait

ruth tait 0 points

  • 3 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Is the file writable by the user PHP runs as? From the error it looks like perhaps it's not.

I'm still getting this same message... very frustrating because I have no idea how to fix this.

"Configuration file is missing or PHP does not have permission to write to it. Make /Users/apple/Sites/..../config/config.php writable"

I can access my localhost in the stack without a problem; but I can't access the Perch site instance. I haven't found anything in the MAMP information about making PHP writable and it doesn't make sense if the localhost server resolves fine, does it?

Drew McLellan

Drew McLellan 2638 points
Perch Support

What permissions are set on the file?

which file are you referring to? MAMP or the Perch config.php file. I've tried setting -R 764 on the site and on MAMP but that doesn't seem to work.

Drew McLellan

Drew McLellan 2638 points
Perch Support

It's been years since I last looked at MAMP, so I'm not sure what's available there.

Can you try 0775 on the perch/config/config.php file itself?

here is permission line: -rwxrwxr-x@ 1 apple staff 0 26 Mar 14:57 config.php

but message still the same. Can you recommend another possible stack? I've always used MAMP but it doesn't seem to be happy with Perch.

Here's verbose warning (which I'm still not sure how to solve):

( ! ) Warning: session_start(): Failed to read session data: files (path: /Applications/MAMP/tmp/php) in /Users/apple/Sites/firstunitarianottawa/1uo_admin/core/lib/PerchSession.class.php on line 27

( ! ) Warning: session_start(): Session data file is not created by your uid in /Users/apple/Sites/firstunitarianottawa/1uo_admin/core/lib/PerchSession.class.php on line 27

Hi Ruth

Perch works fine on MAMP. I would suggest it's your installation that's not running correctly – it sounds like permissions are up the spout. Have you tried updating to the latest version or reinstalling MAMP? MAMP can be a really mardy app!

Jon

Hi Jon: I re-installed most recent MAMP. The reason I'm guessing there's a conflict with Perch, is that I can load my 'localhost' fine. Error only comes when I try to load my Perch instance.

How about coding the config.php file yourself? If writing the config file is the problem, at least this might get you to the next step.

https://docs.grabaperch.com/perch/configuration/

still no luck with the perch setup. Unfortunately, I'm not a programmer: I tried but I'm pretty sure I don't have enough knowledge of php to make up my own config file... I am working with a team and it's possible I can get help from other members (but, we aren't meeting for awhile and I want to get as much information as possible to brief them).

So far, I've re-installed the Perch instance and MAMP.

Now, I seem to have passed thought the first gate but the problem now is connecting to a database. The message I'm getting is:

"Those connection details resulted in the following error message:

SQLSTATE[HY000] [2002] Connection refused" I've tried with Google but haven't figured out how I fix this in Perch. I don't know how Perch connects to a db and I don't know how I should be labeling the db -- as it is presumably new.... although the field is 'required' MAMP states mysql server is connected.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Perch connects to the database using four bits of information from your config file: the host, database name, username and password.

Do you have those four pieces of information, and know them to be correct?

The "Connection refused" error sounds to me like you're targeting the host correctly, and the server is running, but your username and/or password are incorrect.