Error 500 Php_value .htaccess
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up 500 Internal Server Error when using .htaccess for PHP Settings up vote 11 down vote favorite 2 When I am using .htaccess for the following PHP settings, I am getting 500 Internal Server Error while accessing the website. the code in the .htaccess file: php_flag display_errors off php_flag log_errors on The file permission for the .htaccess file is 644 I know that code above is correct. But when it showed me 500 Internal Server Error, I tried different code (most probably wrong) too, but nothing worked. The different code tried are: php_value display_errors off php_value log_errors on and php_value display_errors 0 php_value log_errors 1 What can be the cause of 500 Internal Server Error? After learning from the comments on this question, I found that PHP settings on .htaccess does not work with FastCGI. So, to change PHP settings, I need to modify the php.ini or I need to do it in the php code. Is there any alternate way, when I don't have access to modify php.ini file and I don't want to individually modify all the PHP files? php .htaccess share|improve this question edited Jun 10 '12 at 18:36 asked Jun 7 '12 at 8:32 Debiprasad 1,06652550 1 Do you have access to the Apache error.log file? –Pekka 웃 Jun 7 '12 at 8:34 Does the page loads when you delete the .htaccess file? –Joey Jun 7 '12 at 8:34 2 Are you actually using mod_php in your Apache configuration? If you are running PHP via CGI or FastCGI, you cannot configure it through .htaccess. –lanzz Jun 7 '12 at 8:36 @Pekka I am looking for Apache error.lo
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join http://stackoverflow.com/questions/10928328/500-internal-server-error-when-using-htaccess-for-php-settings them; it only takes a minute: Sign up .htaccess php_value auto_prepend_file makes 500 error. How can I fix this? up vote 3 down vote favorite 5 My .htaccess is as follows: Options +FollowSymLinks RewriteEngine On RewriteBase /school RewriteRule ^([a-zA-Z0-9]+)/$ index.php?page=$1 RewriteRule ^([a-zA-Z0-9]+)$ index.php?page=$1 php_value auto_prepend_file ./inc/library.php ErrorDocument 404 /school/index.php?page=404 As of the ./, I read that indicates a relative path. http://stackoverflow.com/questions/14885311/htaccess-php-value-auto-prepend-file-makes-500-error-how-can-i-fix-this .htaccess php share|improve this question edited Feb 14 '13 at 23:54 asked Feb 14 '13 at 22:32 user2060274 16115 ./ means "a path relative to the current work directory". You are sure, that the file is there, where it is expected to be? Try an absolute path. Also ensure, that the file doesn't produce any errors itself. –KingCrunch Feb 14 '13 at 23:59 I think I am cgi, but can I make a php.ini in any directory? –user2060274 Feb 15 '13 at 0:11 It isn't related to php.ini in this case. But no, you can't: The interpreter wont look for it ;) –KingCrunch Feb 15 '13 at 0:13 I am cgi, so I can't use ht access... I need to set php.ini varibles, but I don't have access to php.ini –user2060274 Feb 15 '13 at 0:15 Ah, right, CGI ^^ If you are using FastCGI via php-fpm (which if its not the case you definitely should consider) you can set the values in the pool-settings php
Error. I played with my htaccess file and found that this line php_value display_errors 0 is causing the error. When https://www.sitepoint.com/community/t/internal-server-error-when-htaccess-has-php-value-display-errors/6450 I delete the site works again. What gives? This line works perfect with my old server and I've never had an issue. I need error reporting shut https://www.daniweb.com/programming/web-development/threads/414949/htaccess-error-number-500 off. Is there a new way to do it? Cheers!Ryan dklynn 2010-08-11 10:46:56 UTC #2 cb, The error appears to be that the value is supposed to error 500 be a string: http://nz.php.net/manual/en/errorfunc.configuration.php#ini.display-errors. Regards, DK casbboy 2010-08-11 16:49:52 UTC #3 Thanks for the response, but I don't necessarily understand what you mean. Cheers!Ryan casbboy 2010-08-11 17:02:20 UTC #4 Tried this: php_flag display_errors Off (obviously just guessing now) still an internal error. Is there something I need to enable/compile into the new server to allow error 500 php_value the htaccess edits? Ryan dklynn 2010-08-11 22:13:15 UTC #5 cb, Yes, put the value in quotes! Did you check the link I put in the last post? It'll show you by example. Regards, DK casbboy 2010-08-11 22:41:12 UTC #6 My bad, I forgot to mention I tried that but assumed wrong. Did: php_value display_errors '0' and php_value display_errors "0" and php_value display_errors "Off" All brought an internal server error. That's what I took from the example. Am I missing something else? Thanks for helpRyan casbboy 2010-08-12 06:42:42 UTC #7 Ok, I think I've tried every possible combination of lines and still getting Internal Server Error. This htaccess file worked perfect before, but it looks like moving past PHP 5.3 is causing the issue (my last was 5.1x) Where am I being held up? Remember, I'm just trying to shut off display_errors in the htaccess file. Cheers!Ryan BreezeHost 2010-08-12 15:50:39 UTC #8 The php in your server might be running php with suPHP e
linux hoting server to change the "upload_max_filesize" and some other settings. but it shows the internal server error 500. how to change this setting on my server, Plz help me:( htaccess file code. php_value upload_max_filesize 50Mb php_value post_max_size 50Mb php_value max_execution_time 500 php_value max_input_time 500 R.Manojkumar 5 posts since Mar 2012 Community Member 3Contributors 4Replies 5Views 4 YearsDiscussion Span 4 Years Ago Last Post by karthik_ppts htaccess php Ask a Different Question 1 Featured Reply veedeoo 474 4 Years Ago Hi, It all depends on server configuration. You will need to find out these configurations by using the codes below. Save as anyfileYoulike.php Upload to your server and direct your browser to this file. Look for the value of Server API . If your server says CGI or FAST CGI, then you need to make those entries on php.ini file. Meaning, you can create a new file and name it as php.ini, and then upload it to your server. It could be either in the same level of the directory needing the increase in max_filesize or above it. Here is the content of your php.ini file upload_max_filesize = 50M post_max_size = 50M max_execution_time = 500 max_input_time = 500 If your server API says, Apache 2.0 Handler , apache module or anything about apache, then your .htaccess file should look like this php_value upload_max_filesize 50M php_value post_max_size 50M php_value max_execution_time 500 php_value max_input_time 500 Remember to check what is on your phpinfo() first.. normally your upload_max_filesize would show 8M and not 8Mb... WARNING! You CANNOT use BOTH.. ONLY ONE mUST be selected.. CGI or Apache... Comments R.Manojkumar: Thank your very much, problem solved brother 0 karthik_ppts 81 4 Years Ago Why can't you try this with your php file ini_set("upload_max_filesize","50Mb"); ini_set("post_max_size","50Mb"); ini_set("max_execution_time","500"); ini_set("max_input_time","500"); 0 Discussion Starter R.Manojkumar 4 Years Ago Thank u so much brother, i fell good 0 karthik_ppts 81 4 Years Ago Mark this thread as solved if your problem solved Know someone who can help? Share a link on social media … This question has already been answered. Start a new discussion instead. Message Insert Code Snippet Alt+I Code Inline Code Link H1 H2 Preview Submit your Reply Alt+S Related Articles OOP member function query() on a non-object issue 21 replies Hi, I been learning