Hi There!
I recently migrated files and DB from a really old droplet to a new LAMP 1-click install droplet. I installed a Let’s Encrypt SSL cert and the site is resolving at its domain clients.nevilleco.com. The issue I’m having is that any PHP-generated pages are throwing a 500 error. It seems like it may be both internal server errors (apache) and HTTP errors (PHP).
If you click on ‘Client Services’ in the left-hand menu you’ll see an internal server error 500 logged in the console. If you click on the Newsroom and then Press Releases it seems like you get an HTTP 500 error (at least according the Chrome).
I’ve gone through a number of posts in the community about this issue and I’ve run the CHOWN command to set Apache as owner of the site files as described here https://www.digitalocean.com/community/questions/setting-permissions-for-wordpress and still no dice.
Running tail -50 /var/log/apache2/error.log
gives me
[Wed Jun 17 06:25:15.958469 2020] [mpm_prefork:notice] [pid 1585] AH00163: Apache/2.4.18 (Ubuntu) OpenSSL/1.0.2g configured -- resuming normal operations
[Wed Jun 17 06:25:15.958554 2020] [core:notice] [pid 1585] AH00094: Command line: '/usr/sbin/apache2'
[Wed Jun 17 11:48:15.708434 2020] [:error] [pid 19792] [client 195.54.160.135:49592] script '/var/www/html/www.nevilleco.com/index.php' not found or unable to stat
And the access.log
tail -50 shows this:
https://gist.github.com/AndrewSepic/a4a2b412de3407bd1aaf87036876eb9f
My virtual hosts file looks like this:
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerAdmin dev@unionstmedia.com
ServerName clients.nevilleco.com
ServerAlias www.clients.nevilleco.com
DocumentRoot /var/www/html/www.nevilleco.com
<Directory /var/www/html/www.nevilleco.com/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<IfModule mod_dir.c>
DirectoryIndex index.php index.pl index.cgi index.html index.xhtml index.htm
</IfModule>
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/clients.nevilleco.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/clients.nevilleco.com/privkey.pem
</VirtualHost>
</IfModule>
<IfModule mod_ssl.c>
<VirtualHost *:80>
ServerAdmin dev@unionstmedia.com
ServerName clients.nevilleco.com
ServerAlias www.clients.nevilleco.com
DocumentRoot /var/www/html/www.nevilleco.com
<Directory /var/www/html/www.nevilleco.com/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<IfModule mod_dir.c>
DirectoryIndex index.php index.pl index.cgi index.html index.xhtml index.htm
</IfModule>
RewriteEngine on
# Some rewrite rules in this file were disabled on your HTTPS site,
# because they have the potential to create redirection loops.
# RewriteCond %{SERVER_NAME} =clients.nevilleco.com [OR]
# RewriteCond %{SERVER_NAME} =www.clients.nevilleco.com
# RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
</IfModule>
Any Help would be super appreciated.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Enter your email to get $200 in credit for your first 60 days with DigitalOcean.
New accounts only. By submitting your email you agree to our Privacy Policy.
Hi there,
According to the error that you’ve shared the path to the index.php file is not correct.
You need to make sure that the document root of your website is actually in the
/var/www/html/www.nevilleco.com
directory. You can use thels
command to verify this:If this is not the case, there are a few things that I could suggest:
Check PHP Version Compatibility: Ensure that the PHP version on your new server is compatible with the version your site was built on. PHP code that was working fine on an older version may break on a newer one.
Inspect PHP Error Logs: Review your PHP error logs for any specific messages related to the 500 errors. These logs may provide more insight into what’s causing the problem. You can generally find them at
/var/log/php7.x-fpm.log
or similar, depending on the PHP version.Review Apache Configuration: From the error message, it appears that the script at
/var/www/html/www.nevilleco.com/index.php
is not found or unable to stat. Make sure that the path is correct and the file has proper permissions.Fix Ownership and Permissions: It might be an ownership or permissions issue. Try running:
Check
.htaccess
Rules: If you’re using.htaccess
files for URL rewriting or other directives, make sure the rules are correct and compatible with your current Apache version.Disable/Enable Modules: Try disabling/enabling certain Apache or PHP modules that might conflict with your configuration.
Verify Virtual Host Configuration: Your virtual host configuration seems fine, but ensure that the document root is correct and that the paths to the SSL certificates are accurate.
Restart Services: After making changes, don’t forget to restart Apache and PHP-FPM (if used):
Hope that this helps!
Best,
Bobby