neogranas Posted November 3, 2008 Share Posted November 3, 2008 I started the thread here, did get some response but it didn't go far. I was hoping I could get some more answers. I have a Fedora 9 server running Apache 2 and PHP 5. For the life of me I cannot get .htaccess to work at all, and if I put a second php.ini file outside of /etc, say in the folder where I had a Joomla install, it would not recognize it. I was told that I had to compile php as a cgi binary, not a module for apache. Does anyone know how to do that or knows of a decent how to article that was already written? Quote Link to comment https://forums.phpfreaks.com/topic/131243-per-user-htaccess-and-phpini/ Share on other sites More sharing options...
steviewdr Posted November 4, 2008 Share Posted November 4, 2008 You will need to get .htaccess working firstly. Try the following in a .htaccess file: ### deny from all ### and see if you get a webpage access denied. If it does not work, then you'll need to add "allow overrride all" to your apache config. Once you have .htaccess working for a particular directory, then you can look towards using a specific php.ini. -steve Quote Link to comment https://forums.phpfreaks.com/topic/131243-per-user-htaccess-and-phpini/#findComment-681928 Share on other sites More sharing options...
neogranas Posted November 6, 2008 Author Share Posted November 6, 2008 In my domain's virtual host config file I have that AllowOverride all set for my public folder, still am not getting any .htaccess commands to work. Quote Link to comment https://forums.phpfreaks.com/topic/131243-per-user-htaccess-and-phpini/#findComment-683952 Share on other sites More sharing options...
neogranas Posted November 10, 2008 Author Share Posted November 10, 2008 deny from all did not work, however, I did get a rewrite to work. So I assume it is working, but not fully or as I would expect. And I should clarify, it's not really per 'user' it would be per directory so I can have a php.ini or .htaccess in any directory containing the rules and settings that I want for that directory specifically. Quote Link to comment https://forums.phpfreaks.com/topic/131243-per-user-htaccess-and-phpini/#findComment-686969 Share on other sites More sharing options...
neogranas Posted November 10, 2008 Author Share Posted November 10, 2008 Someone helping me came across suphp to allow php scripts to run as apache or non-root. I checked for it on my server. It wasn't installed so I installed it, apache said it was already configured for it so I restarted apache and still no luck. Quote Link to comment https://forums.phpfreaks.com/topic/131243-per-user-htaccess-and-phpini/#findComment-687137 Share on other sites More sharing options...
steviewdr Posted November 11, 2008 Share Posted November 11, 2008 You need to get htaccess working. A rewrite could still work without a htaccess file. See also: https://wiki.skynet.ie/Admin/SetupGuides/suPHP https://wiki.skynet.ie/Users/suPHP -steve Quote Link to comment https://forums.phpfreaks.com/topic/131243-per-user-htaccess-and-phpini/#findComment-688060 Share on other sites More sharing options...
neogranas Posted November 19, 2008 Author Share Posted November 19, 2008 I finally found out how to get it all working. .htaccess: In either the httpd.conf/apache.conf or if you use your own config files in conf.d add this: <Directory /path/to/your/public/folder/> AllowOverride All </Directory> Then any folder after that will also be able to use them. php.ini for your directories: You'll need to install mod_suPHP first. Then in your /etc/httpd/conf.d/suphp.conf file you should see options for: #suPHP_AddHandler php5-script Uncomment that line to activate suPHP, then below that you should see: #suPHP_ConfigPath /etc Below that is where you specify where you want additional directories to be checked for php.ini files. Because I am hosting a few different websites using VirtualHosts, here is what I use: suPHP_ConfigPath /home/*/public_html/* That allows any user's folders in the public_html folder (which isn't actually publicly available, just the ones inside it) to have their own php.ini You'll obviously need to restart apache after configuring all of this, but I tested it on my system and it's working as expected. You'll need to look at different php.ini settings as most will reference root owned folders for some things like sessions and such, but it will at least get it working! It was incredibly simply once I knew what to install. Quote Link to comment https://forums.phpfreaks.com/topic/131243-per-user-htaccess-and-phpini/#findComment-693821 Share on other sites More sharing options...
steviewdr Posted November 19, 2008 Share Posted November 19, 2008 Glad you got it. Thanks for posting your solution here. It might help someone in the future. -steve Quote Link to comment https://forums.phpfreaks.com/topic/131243-per-user-htaccess-and-phpini/#findComment-693838 Share on other sites More sharing options...
neogranas Posted November 20, 2008 Author Share Posted November 20, 2008 I talked to a few other people who knew linux (both Ubuntu and Fedora) better than I, you should have any problem chmod'ing /var/lib/php/sessions to 777, getting around the pesky error about not having access to it, and you don't have to create/specify a different directory for each user. Quote Link to comment https://forums.phpfreaks.com/topic/131243-per-user-htaccess-and-phpini/#findComment-694349 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.