Hi, everyone. I'm trying to conform my PHP settings to the Drupal requirements, and while Apple has made a wonderful server, they tend to put things in strange places. I can't find the php.ini file, nor the .htaccess file. When I run infophp, the only setting that looks badly out of line with the requirements is session.save_handler (it's set to "file" right now). Can I leave it? If not, does anyone here know where I can find or where I should create the php.ini or .htaccess files?! Thanks!

Comments

eliste’s picture

ixnay on the .htaccess file. I edited my httpd.conf to read the Drupal one, and none of the settings were changed, because Mac OS X doesn't play with the php_value command. I.e., it don't work. *sigh* If anyone has ANY idea of how to change the PHP defaults, I would have much love for them.

Anonymous’s picture

AFAIK, OS X plays fine with php_value. Your syntax is probably off or you may be trying to change a config option that is not valid in an .htaccess file. Lots of people make that mistake. What was the php_value line that didn't work? And is there anything relevant noted in /var/log/httpd/error_log?

eliste’s picture

...to check the error log (I tend to forget about those). There was nothing about PHP in there, although it did say a number of files in the Drupal dir (which is /Library/Websites/Documents) are missing, after I tried to make it read the Drupal .htaccess. I checked the permissions, and they are fine. I haven't changed the .htaccess file; in fact, I haven't even opened it. I assumed the php_value command wasn't working because a) I tried it from the command line earlier, and it said it didn't exist and b) using phpinfo, the only thing that changed is now magic_quotes_gpc is mysteriously ON when it was set to 0 before.

I think I'm going to just try and go with creating a php.ini file and pray that works. The annoying thing is, Drupal loads up with no problem. I suppose I still have to fix this though, don't I?

Thanks so much for trying to help me!

Anonymous’s picture

I've got brauer.org running very nicely on 10.2 server. It's been a while since I did it, I've found using a test.php that is setup to run phpinfo() is a good way to see the local settings and if your .htaccess settings matter. (this saved me recently on a FreeBSD installation for another site). The other tool I use extensively is webmin which allows for the editing of the files. I also do edit the httpd.conf and macosconf files. What I do is use the file comparison tool in developer tools to sync the files after an upgrade that touches either of them (they save the old versions as .old)

phpinfo can tell you where the php.ini file being read is too

Anonymous’s picture

I edited my httpd.conf to read the Drupal one, and none of the settings were changed

Changes to an .htaccess file are read immediately. But when you edit httpd.conf, Apache (on any OS) will not read those changes until the daemon has been restarted. Just turn web sharing off, then back on.

eliste’s picture

Yup, I always restart. And the log confirms that it in fact restarted. Good thought, though. Thanks!

Anonymous’s picture

Drupal includes an .htaccess file at the application's root level. Under *nix OSs like Max OS X & OS X Server, any file starting with a period is "hidden", so that's probably why you can't see it in the Finder. Fire up Terminal (/Applications/Utilities/Terminal), then type ls -al /path/to/your/drupal/folder (substituting the real path, of course). You should see .htaccess present there. If you need to edit it, you'll need to use an ASCII text editor like vi, pico, or BBedit, *not* TextEdit (which saves as RTF).

For the php.ini file, see http://www.entropy.ch/software/macosx/php/.

bali’s picture

The easiest way to become compliant with Drupal's requirements is to enable .htaccess for your Drupal site (which is by default disabled on OS X Server). Contrary to other Unix installations you should _not_ edit httpd.conf but httpd_macosxserver.conf to enable .htaccess.

I assume you have used Server Settings app to configure your (virtual) website. Open httpd_macosxserver.conf and find the section that starts with '## The section below contains a block for each site (virtual host).' Locate the block that matches your Drupal site (the block contains something like 'ServerName your.server.name'. Within the block, find the line that reads 'AllowOverride None' and change 'None' to 'All'. Save, restart the webserver with Server Settings app and you're all set.

If you are uncomfortable with Terminal, you can use the Finder's Find command, make sure the 'visibility' citerium is visible and set to 'all', then search for 'httpd_macosxserver.conf' and drop the found file on BBEdit to open it. BBEdit will warn and upon Save you'll need the admin password.

You don't really need the php.ini file. But if you want to create it, it should reside in /usr/local/lib/php.ini.

Entropy's PHP packages are a wonderful help, but the latest release 8 didn't work (on my server at least; Marc claims it has been tested on OS X Server). Anyways Apple's default PHP installation works fine.

Btw I have Drupal running quite smoothly on my OS X Server ;-)

Good luck!

eliste’s picture

I was afraid to edit http_macosxserver.conf because of all the rather snooty warings at the beginning of the file. ;) I actually ended up finding a php.ini file and throwing it in /usr/lib (phpinfo was convinced that was where it lives, so who am I to say otherwise?) and making all the necessary changes in it. Your way is much simpler! (Finding a php.ini file was No Fun.)

You guys are awesome; thanks so much for the support!

Oh, P.S. for OS X Server peeps: if you use the GUI to Copy & Paste the drupal files into your /Library/Webservices/Documents/ directory, OS X willfully blinds itself to the dot files and they don't get transferred. You'll have to cp or mv the dot files in Terminal.