Getting PHP configuration page instead of WordPress login on LAMP stack
Hello.
I'm trying to get wordpress installed manually on a LAMP image of just installed. So far i get my site to pull up the 'PHP' configuration page but nothing else even though i've gone through all the steps.
Going through the different guides and getting support help hasn't proven to be very fruitful and I'm hopeful someone will provide some direction.
The guides say specifically NOT to use www as the hostname but support told me if i want my website to be www.sitename.com then i HAD to use www as the host name.
Can anyone help connecting these together and what might be the cause of the WordPress configuration not initiating when i go to my site?
Thanks
2 Replies
I just ran through LAMP setups (using both a manual installation and using the One-Click App) on Debian 9 and a WordPress installation by following this guide to see where possible issues might have come up, and have the following suggestions (I'm using sitename.com and www.sitename.com as examples):
Clear your browser cache
After I set up my LAMP stack and before I installed WordPress on my Linode, I saw the same PHP configuration page you referred to .
After I installed WordPress, I saw the same PHP configuration page when I would have expected the initial WordPress 'wp-admin' configuration page.
This was due to browser caching — you can quickly confirm whether this is the issue by opening an incognito/private browser window or otherwise clear your browser cache and navigate to your domain(s). After I cleared my cache, I saw the 'wp-admin' configuration page as expected at both sitename.com and www.sitename.com.
Set up your hostname and /etc/hosts
While it probably isn't the issue here, I set my hostname with hostnamectl set-hostname coolhostname
and my /etc/hosts file like so (replacing my Linode's IP address with 12.34.567.89):
127.0.0.1 localhost
12.34.567.89 sitename.com www.sitename.com coolhostname
You can read more about what your /etc/hosts file should look like in this other Community post: What should my /etc/hosts look like?
Configure DNS records
Otherwise, I was able to configure my domain so that both sitename.com and www.sitename.com pointed to my WordPress site by executing these steps:
Configure your registrar so that sitename.com pointed to Linode's nameservers.
Create a domain zone for sitename.com with DNS Manager.
Create two A records under the sitename.com domain zone, one with no hostname set (blank), and one with a hostname set to www, both pointing to your Linode's IP address.
This should ensure that both sitename.com and www.sitename.com are resolving to your Linode's IP address. Note that it can take several hours for DNS changes from your registrar to propagate, and upwards of 30 minutes for DNS Manager changes to take effect. You can test to see if your domains are resolving properly with the following commands:
dig +short sitename.com
dig +short www.sitename.com
(Your Linode's IP address should appear as outputs if you've configured your domains properly and the changes have propagated.)
Configure your Apache Virtual Host
Finally, I set up my website's Virtual Host in a new configuration file at /etc/apache2/sites-available/sitename.com.conf so that it contained only the following:
<Directory /var/www/html/sitename.com/public_html>
Require all granted
</Directory>
<VirtualHost *:80>
ServerName sitename.com
ServerAlias www.sitename.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/sitename.com/public_html
ErrorLog /var/www/html/sitename.com/logs/error.log
CustomLog /var/www/html/sitename.com/logs/access.log combined
</VirtualHost>
I then set up the logs directory with proper permissions (I had already configured the public_html directory when installing WordPress). Finally, I enabled the above configuration and reloaded Apache:
sudo a2ensite sitename.com.conf
sudo systemctl reload apache2
After the above set up (and clearing my browser cache) I reached the 'wp-admin' configuration page when navigating to both sitename.com and www.sitename.com. Hope this helps!