Since I installed suPHP (to be able to run Wordpress properly) I am getting "500 Internal Server Error". Not when I load the WP index.php
, but when I load phpinfo.php
(just the phpinfo function). Also phpMyAdmin can no longer log in (Chrome brings up a "save file as" dialogue instead).
So I found this answer. Only now the php.ini
file seems to be causing trouble, and every page throws a 500 error, even index.php
which was loading before. Here is my php.ini
in full, as suggested by that site, only it breaks everything for some reason:
register_globals = On
allow_url_fopen = On
upload_max_filesize = 80M
post_max_size = 80M
memory_limit = 80M
upload_tmp_dir = 80M
max_execution_time = 20000
and here is the .htaccess
:
suPHP_ConfigPath /home/computer/Documents/Cf
<Files php.ini>
order allow,deny
deny from all
</Files>
I'm on Ubuntu Desktop 12.10. My virtualhost is pointing to my ~/Documents
directory (everything was working fine before installing suPHP).
This is my first time setting up LAMP (I've been using repackaged MAMP/LAMPP until now... I want to learn how to manage a full LAMP setup, but I've been fighting with this thing all day and not being able to get any work done).
EDIT: Changing ownership (sudo chown -R www-data
) of all the files to Apache enables me to write files from script... but still I'm unable to figure out what goes wrong with suPHP. I've disabled it until this is resolved.
Chrome is asking you to "save file as" because your php file handler is botched and when Apache doesnt know how to use a file it just offers it up for download. Manually configuring Apache to work with PHP handlers (outside of mod_php) is not for the faint of heart, so I applaud taking on this challenge. While I've only had experience with CentOS and not Ubuntu, outside of any get/make differences, this guide should apply universally to cover the steps and see if you missed anything.
http://markus.revti.com/2010/03/installing-suphp-on-centos-5/
More than likely your problem is not from bad php.ini or htaccess settings, its from you missing something in your httpd/virtualhosts config where you load the suPHP module, turn on the suPHP engine, set the suPHP handler, setting your suphp.conf file, etc. If that were all correct and it were just a permissions issue of the suPHP_UserGroup your server would not be barfing .php source code files.
Get it serving pages right before you go tweaking your php.ini. I'm not sure what those values are being suggested for but those are not ideal, like for example the max_execution_time of 20000 seconds (5.56 hours) or having post & upload limits the same size as your PHP script memory limit.