I run a 3rd party PHP application on my small local Amplifier stack on my small Mac. I lately purchased a new Mac Small with Lion, and am trying to put it together. These computer would be a Megabytes air with MAMP. Now I am while using built-in apache/php along with a homebrew installed MySQL.
Here's my problem: I've got a directory with symbolic links. These symlinks will be to sites, and also the PHP application is checking these with
On my small Lion Amplifier setup, this
is_dir() is failing. Exactly the same setup on my small Snow Leopard MAMP
is_dir() works fine with my symlinks.
Here's where it will get more curious. Basically do
php -a (php interactive command line mode), and do
is_dir() on the identical sites, it returns true. It only returns false poor an apache request. This will make me think it's something related to the apache user (that is
_www) the inability to access the symlinks. Troubleshooting this falls outdoors of my expertise.
- Yes, I've
FollowSymLinksswitched on during my apache config, as well as in fact, your directory in which the symlinks under consideration reside is really a symlink itself. Apache doesn't have trouble with it. Until PHP
- No, I am unable to edit the PHP application and merely select from
- This identical setup done my Snow Leopard/MAMP setup.
Ah saw your discuss altering these to
777 but nonetheless wondering why it isn't working.
My solution below may not assist you to.
If you can get
edit it via
sudo vi /etc/apache2/httpd.conf.
Then change these 1 of those lines or each of them
User _www Group _www
Here's a good example of my directory listing.
ace:remote-app ace (git::master)$ ls -al total 72 drwxr-xr-x 24 ace staff 816 7 Aug 00:24 . drwxr-xr-x 11 ace staff 374 4 Aug 13:46 .. drwxr-xr-x 3 ace staff 102 12 Jul 17:06 .bundle drwxr-xr-x 14 ace staff 476 7 Aug 02:29 .git -rw-r--r-- 1 ace staff 100 1 Aug 19:20 .gitignore -rw-r--r-- 1 ace staff 9 1 Aug 19:20 .rspec drwxrwxr-x 10 ace staff 340 14 Jul 15:58 public
Now my public directory has
775 permissions, meaning
group have full permissions while other customers are only able to read and execute.
It is dependent if you would like apache user being
ace in the default
_www or even the apache group being
staff in the default
Once you have made the decision which to alter, restart apache.
As well as your page should now have the sites / files.
One factor to notice is you need to change possession for files which have been recently been compiled by your web page as individuals have
_www:_www possession and also you will not get access to them following the restart.
You are able to change their new possession through this,
-R is to really make it recursive.
sudo chown -R newapacheuser:newapachegroup <path>
Have you check permissions/owner?
In the PHP manual: Note: The outcomes of the function are cached.