Hello, Recently I have installed SuPHP/phpSuExec on my server. ================================== [root@server public_html]# /usr/local/cpanel/bin/rebuild_phpconf --current Available handlers: suphp dso cgi none DEFAULT PHP: 5 PHP4 SAPI: none PHP5 SAPI: suphp SUEXEC: enabled ================================== After installing it I have noticed that Memory Usage of my webserver is decreases is that because of SuPHP/phpSuExec? And secondly the main issue is that of .htaccess I mean in few places I really need .htaccess, but as we know that when running SuPHP/phpSuExec we have the following issue. I also tried adding that all coding in .htaccess to php.ini and Place the following code in .htaccess of that folder But its also not working. Please suggest me how to use .htaccess, and yes one of my friend told me to give 777 permission to .htacces it will work then, But its also not working. Please suggest me, I really want a solution. -Regards.
Any file chmoded to 777 will fail, and you will receive Internal Server errors. The .htaccess file should still work, for things like mod_rewrite and other common settings, you cannot however, place any sort of php_config values within these files. What are you trying to get to work in your current .htaccess file that is not working?
here is what i have in .htaccess # Disable directory browsing #Options -Indexes # Follow symbolic links in this directory # Options +FollowSymLinks # Customized error messages ErrorDocument 404 /sms-messages/index.php # Set the default handler DirectoryIndex index.php <Files vote> ForceType application/x-httpd-php </Files> <Files submit> ForceType application/x-httpd-php </Files> please advice.
when I click the vote button or submit button it comes up with a box with option of Open with and Save as, Instead of opening the page.
And this was working prior to changing the handler to suphp? What version of apache are you running as well?
Try changing your code to this: <Files vote> ForceType x-httpd-php </Files> <Files submit> ForceType x-httpd-php </Files> Code (markup):
Can you check the error logs and see what they are reporting? You can also try SetHandler, and see if that works: SetHandler application/x-httpd-php
Don't you think its because of SuPHP/phpSuExec as php functions can't be used in .htaccess while running SuPHP/phpSuExec?
run the following: find /home/your_username/public_html/ -type f -exec chmod 644 {} \; find /home/your_username/public_html/ -type d -exec chmod 755 {} \; Then throw a php.ini in your public_html with all changes made.
ok, take the following out of your .htaccess <Files vote> ForceType x-httpd-php </Files> <Files submit> ForceType x-httpd-php </Files> You won't need this, while testing. do NOT chmod your .htaccess to 777, it will break the site. You need to make sure all files and directories are owned by the user. Now, run the above commands I gave you. I'm seeing you're on a cPanel server, do the following: cp -pr /usr/local/lib/php.ini /home/your_username/public_html/ Now make sure that you don't have php_value or php_flag in any of your .htaccess files, you'll want to edit the php.ini that you've just made in your user's public_html to reflect these values. Now after following the above instructions, your .htaccess should only have the following 2 lines of any relevance to the original: DirectoryIndex index.php ErrorDocument 404 /sms-messages/index.php ok, now check your site out. So long as all files/folders have ownerships of your user and files permissions = 644 and directories 755, your site will be loading. If you have further issues feel free to pm me and I'll be glad to take a look.
Well I have followed what you have recommended, I added the following lines php.ini .<Files vote> , ForceType application/x-httpd-php .</Files> , .<Files submit> , ForceType application/x-httpd-php .</Files> But its still not working.
please dont put .<Files vote> , ForceType application/x-httpd-php .</Files> , .<Files submit> , ForceType application/x-httpd-php .</Files> in your php.ini
I think the following thread will help you to troubleshot the issue: http://www.webhostingtalk.com/showthread.php?t=691706 Kailash
i have done it by making the doing changes in .htaccess. RewriteEngine On RewriteCond %{SCRIPT_FILENAME} !-f RewriteCond %{SCRIPT_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 -Regards.