.htaccess Error, While modifying php configuration - php

If this is not posted in correct place, please migrate it
I kept a .htaccess file in my public_html folder inside the root. When I view the website it is giving server misconfiguration error.
my .htaccess file contains this only
php_value upload_max_filesize 100M
php_value post_max_size 100M
I wonder what may be wrong. Any Ideas
MY ERROR LOG
[Mon Jun 07 17:06:23 2010] [alert] [client 113.199.221.198] /home/wwwcomr/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration
[Mon Jun 07 17:04:46 2010] [alert] [client 113.199.221.198] /home/wwwcomr/public_html/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration

What Col. Shrapnel says: The error log is the only place to get reliable information.
Re your update:
PHP needs to be running as an Apache module for php_value to work. Source

See web-server's error_log for the details.

Related

Why I am getting 404 when trying to open a file from My Documents folder? [duplicate]

The title describes the question.
I have PHP installed, Apache, MySQL and also phpMyAdmin in the htdocs folder of Apache. I installed them separately and do not use a compilation package. I did try to create a php file with phpinfo
<?php
phpinfo();
?>
Saved the file as phpinfo.php
When going to
http://localhost
I see the phpinfo.php file listed. When I click the phpinfo.php file
I get a 404 error. There are no other files listed in the root http folder except one (phpinfo.php)
PHP was installed and php short tags are enabled
short_open_tag = On
I am not sure if it's a capital On or on
Note: I used http://www.jesterwebster.com/setting-up-a-test-bench-web-server-with-apache-php-mysql-and-more-on-windows/26 as a guide for my Apache and PHP install
I opened the error log and I found something disturbing. Not sure how to fix it
[Fri Aug 03 13:07:34 2012] [error] [client 127.0.0.1] File does not exist: C:/website/example/online/Program Files, referer: http://localhost/
[Fri Aug 03 13:09:33 2012] [error] [client 127.0.0.1] File does not exist: C:/website/example/online/Program Files, referer: http://localhost/
Per your error logs, your DocumentRoot "C:/websites/example/online" is websiteS, your error log is looking for website without the s.
Have you confirmed from apache configuration file that PHP is enabled and is configured correctly to work with apache? And has the apache server been restarted after configuration? Also Try adding an html file in the htdocs directory to confirm if the directory is correct.
Edit: Also you mentioned that error log is looking for your file in this directory
C:/website/example/online/Program Files
But you mentioned that you placed phpinfo.php in htdocs folder for apache. There might be an issue related to difference between those two paths

Error 500 when i use htaccess

I made .htaccsess for include path and i set in it
php_value include_path ".;c:\xampp\php\PEAR;c:\xampp\htdocs\shop\shop\inc";
there is just top line(htaccess)
my project is in locall
and my include file is in directory: c:\xampp\htdocs\shop\shop\inc
but when i use function or classess in my include directory i get This Error:
Server error!
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.
If you think this is a server error, please contact the webmaster.
Error 500
localhost
Apache/2.4.7 (Win32) OpenSSL/1.0.1e PHP/5.5.9
in error.log apache is
[Sun Oct 19 17:07:08.037451 2014] [core:alert] [pid 2228:tid 1676] [client ::1:52965] C:/xampp/htdocs/shop/shop/.htaccess: php_value takes two arguments, PHP Value Modifier
[Sun Oct 19 17:07:09.559628 2014] [core:alert] [pid 2228:tid 1676] [client ::1:52966] C:/xampp/htdocs/shop/shop/.htaccess: php_value takes two arguments, PHP Value Modifier
php_value include_path ".;c:/xampp/php/PEAR;c:/xampp/htdocs/shop/shop/inc"
Try it with forward slashes and without the semicolon at the end.
Also retype the spaces to make sure you've not introduced some non ascii character into the string.

PHP not using session path specified in php.ini File

I'm having an issue where PHP is trying to use the default session directory (/var/lib/php/session) even though I have set it to something different in my php.ini file:
session.save_path = "/WEB/SESSIONS"
I have the exact ini file on another web server and no issue. I'm using PHP 5.5 with Apache. I have verified that PHP is trying to use /var/lib/php/session by looking at phpinfo and from the Apache error log:
[Mon Aug 04 14:32:18 2014] [error] [client x.x.x.x] PHP Warning:
Unknown: open(/var/lib/php/session/sess_e9bvjjf77tbpo40r86e5pegl80,
O_RDWR) failed: Permission denied (13) in Unknown on line 0, referer:
https://x.x.com/
This is usually pretty straight forward for me but not sure why I'm having an issue. Would appreciate any advice! Thank you!

PHP page doesn't load. Instead it gives me a 404 error

The title describes the question.
I have PHP installed, Apache, MySQL and also phpMyAdmin in the htdocs folder of Apache. I installed them separately and do not use a compilation package. I did try to create a php file with phpinfo
<?php
phpinfo();
?>
Saved the file as phpinfo.php
When going to
http://localhost
I see the phpinfo.php file listed. When I click the phpinfo.php file
I get a 404 error. There are no other files listed in the root http folder except one (phpinfo.php)
PHP was installed and php short tags are enabled
short_open_tag = On
I am not sure if it's a capital On or on
Note: I used http://www.jesterwebster.com/setting-up-a-test-bench-web-server-with-apache-php-mysql-and-more-on-windows/26 as a guide for my Apache and PHP install
I opened the error log and I found something disturbing. Not sure how to fix it
[Fri Aug 03 13:07:34 2012] [error] [client 127.0.0.1] File does not exist: C:/website/example/online/Program Files, referer: http://localhost/
[Fri Aug 03 13:09:33 2012] [error] [client 127.0.0.1] File does not exist: C:/website/example/online/Program Files, referer: http://localhost/
Per your error logs, your DocumentRoot "C:/websites/example/online" is websiteS, your error log is looking for website without the s.
Have you confirmed from apache configuration file that PHP is enabled and is configured correctly to work with apache? And has the apache server been restarted after configuration? Also Try adding an html file in the htdocs directory to confirm if the directory is correct.
Edit: Also you mentioned that error log is looking for your file in this directory
C:/website/example/online/Program Files
But you mentioned that you placed phpinfo.php in htdocs folder for apache. There might be an issue related to difference between those two paths

mod_rewrite causes apache to crash with Rewritemap prg directive

Apache configuration:
RewriteEngine on
RewriteLock /var/www/lib/rewrite.lock
RewriteMap sessionValid prg:/var/www/lib/allow.php
I fixed the obvious of setting the file executable, but now it is giving this:
[Fri Feb 12 01:55:31 2010] [error] (2)No such file or directory: exec
of '/var/www/lib/allow.php' failed
But the file clearly exists.
...Forgot to make allow.php executable for the apache user.

Categories