daitya
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Critical Error – help explain debugging log?Thanks to Tuhin Ahmed (@2h1n846) the problem has been resolved. Contacted host support, and they discovered that a PHP upgrade on the shared server had impacted the WordPress installation. Have successfully upgraded WordPress, and hosting support reverted PHP to v7.4.
- This reply was modified 1 year, 3 months ago by daitya.
Forum: Fixing WordPress
In reply to: Critical Error – help explain debugging log?Thank you, very helpful.
Hi John, please correct me if I’m wrong, but I will assume that you have used Xampp or another similar app to create staging with localhost on your computer.
In my case, I had originally set up my staging without virtual hosts, so my URLs were https://localhost/website.loc. WordPress installed without any issues and the browser was able to open the site. That is, until I enabled the Multisite Network. WordPress wasn’t having it. As explained in my original post, WordPress was unable to connect to the database. Creating a virtual host for the site fixed the problem.
I’ve never used a linux OS; I’m a Mac user, so the steps I took to set up virtual hosts are slightly different to what you will do with linux, but the end is the same. Here’s a post that ought to help you set up a virtual host for your website: https://gist.github.com/ibrahimtuzlak0295/7fcd9c0f52f91ba6ccffdc0049723edf.
After creating your virtual host, you’ll want to flush your DNS cache, then restart Xampp. You’ll also need to replace the URLs in your database. I did this with Interconnect IT’s search-replace script – very handy, but remember to put guid as an exception.
As you have already installed WordPress and tried to enable Multisite, you will need to open wp-config.php with a text editor and delete the Multisite code you pasted in. Comment the line enabling Multisite. Save. After you have done this, test access to your website. Point your browser to https://website.loc or log into https://website.loc/wp-admin. If you are able to view the site or access the dashboard, your virtual host is working.
Now, again open wp-config.php and uncomment the line enabling Multisite. Then visit the dashboard, go to Tools > Network and copy the blocks of code to the relevant files (wp-config.php and .htaccess). Once you have done that, you should be able to connect to the network.
For other Mac users who are using MAMP, I’ll document what I did to set up my virtual host. I’m using MAMP 5.7, with these settings: PHP 7.4.2, MySQL 5.7.26 and ports as follows: Apache 80, Nginx 80, MySQL 3306.
Open Terminal and type:
cd /private/
and hit return. On the next line type:sudo pico /etc/hosts
and hit return. You’ll be prompted for your password, and upon entering it, Terminal will open the hosts file. Scroll down (using the arrow key) past 127.0.0.1 .localhost. Below this type the virtual host site name:127.0.0.1 website.loc
(if you are creating more than one virtual host, type each one on a separate line). Hit control-O to save, then the return key, then control-x to exit. Close Terminal.If MAMP is running, stop it. Using a text editor like Atom, open Applications > MAMP > conf > apache > .httpd.conf. Scroll towards the bottom of the document, and uncomment #Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf. Save. Then navigate to the httpd-vhosts.conf file, open it, and add the following:
NameVirtualHost *:80 <VirtualHost *:80> DocumentRoot "path to your website" ServerName localhost </VirtualHost>
<VirtualHost *:80> DocumentRoot "path to your website" ServerName website.loc </VirtualHost>
Replace “path to your website” with your path. For example, my document root is “Users/Documents/Websites/website.loc”. Replace website.loc with the name of your website. I use .loc as the extension for my website, but you could use anything, really.
Save the changes, then exit.
Open Terminal and flush the DNS cache. Depending on your Mac OS, the command may be different. I used
sudo killall -HUP mDNSResponder
and that did the trick.Now launch MAMP. The next step is to replace the URLs in the database. Change from localhost/website.loc to website.loc. For this, I recommend using Interconnect IT’s script, available at https://interconnectit.com/search-and-replace-for-wordpress-databases/. Remember to put guid as an exception, as www.ads-software.com advises not to change the URLs in guid.
After running the script, delete it from your server (for security purposes). Refresh the database.
Now you should be able to point your browser to https://website.loc and if you haven’t already installed WordPress, installation will begin. If you have already installed WordPress, you will need to edit the wp-config.php file to enable Multisite network. Then in the dashboard, navigate to Tools > Network Setup, copy the blocks of code and paste them into the relevant files.
For detailed explanation how to set up WordPress Multisite with MAMP, here is a helpful guide: https://perishablepress.com/wordpress-multisite-mamp/. For detailed explanation how to move a live WordPress site to local staging, https://www.wpbeginner.com/wp-tutorials/how-to-move-live-wordpress-site-to-local-server/.
For detailed explanation how to set up virtual host on Mac (OSX Sierra): https://medium.com/@jason.amador/setting-up-virtual-hosts-with-apache-on-macos-sierra-7d7d7a1f551a
Forum: Networking WordPress
In reply to: Network Admin not reachable – Redirect ErrorPerhaps you have found help elsewhere in the meantime? Please clarify: Are you working on a live site or are you staging the network on your localhost?
Are you able to log into the Network Admin on the live site? If not, this could be a conflict with a new version of PHP running on the server where the site is hosted. Since the WP installation hasn’t been updated for about 3 years, that version is not compatible with PHP 7. I recently ran into this with some of my websites. Check with the web hosting service and ask if it’s possible to downgrade to PHP 5.4 temporarily to enable you to log into WP admin.
The next step, if you haven’t already done it, is to take a backup of the database with phpMyAdmin and then backup the public_html directories and files using ftp.
When setting up your local WP Multisite network, did you create a virtual host? I recently ran into the problem you have. After enabling Multisite network, WP was unable to connect to the database, whereas WP without the network enabled was able to connect. WP doesn’t like local installations using the address localhost/siteurl. The answer is to create a virtual host. Make sure that you replace the URL in the database with the virtual host siteurl. Then enable Multisite in wp-config.php, log in, go to Tools > Network and copy-paste the blocks of code into wp-config.php and .htaccess and you should be good to go.
Hope this is helpful.
UPDATE
At last figured out that WordPress was unhappy with the localhost/siteurl configuration. I ended up creating a virtual host, then replaced the URLs in the database to match the virtual host url. Enabled Multisite network in wp-config.php. Logged in to WP > Tools > Network, copied and pasted the blocks of code into wp-config.php and .htaccess, and Voilà! All is well.Forum: Fixing WordPress
In reply to: Mystery of the Missing Admin Features under PostsWhat theme are you using? Try activating one of the stock themes included with the WordPress download. Also deactivate all plugins. Does the error still appear?
If the plugin has locked you out, perhaps all you need to do is renameyour plugins folder. If your host has locked you out, then you’ll need to contact support and request them to unblock you. Read https://codex.www.ads-software.com/Hardening_WordPress.
Forum: Fixing WordPress
In reply to: Add media button does nothingSorry, it’s over my head, but you might take a look at this post and see if your host can help you out. https://www.ads-software.com/support/topic/cannot-add-new-media-since-38-upgrade?replies=15
Forum: Fixing WordPress
In reply to: Large Site Size 300mbTry the plugin WP Cleanup. Saved my derriere.
Forum: Fixing WordPress
In reply to: Can't add media to post/page after upgrade to 3.8If you haven’t been able to resolve the issue yet, take a look at https://www.ads-software.com/support/topic/mystery-of-the-missing-admin-features-under-posts?replies=5 and see if this is anything like what you’re experiencing.
Forum: Fixing WordPress
In reply to: .htacess 301 redirect helpForum: Fixing WordPress
In reply to: WordPress won't acknowledge my username!Is it possible you’re talking about a wordpress.com account?
What WP version are you running? And which theme? PHP version? Troubleshoot as follows, one by one and see what is the result: —
1. Activate the stock theme, not customized theme.
2. Deactivate all plugins.
3. reset plugin folder.
4. Check your database, repair any tables with overhead, and optimize.
5. Back up database.
6. Update WP. Or if WP version is latest, update core.
7. Put website in maintenance mode and delete all folders and files EXCEPT wp-content, wp-config and .htaccess. Download fresh WP install, and upload the new folders and files, all EXCEPT wp-content, wp-config and .htaccess.Does the server 500 error happen only when you try to change your WP theme? Or is it possible that excessive server activity and demand for memory is causing server error in your shared hosting account? If this is the case, it might not be related to your WP installation; rather it might be due to brute force attacks on your wp-login.
Forum: Fixing WordPress
In reply to: How to make a WP site live.Hi Peter, you’ll want to consider whether you intend to keep any part of the old website in operation and whether any of those files at root in public_html can live side by side with a new WP installation at root. If your landing page is going to be your new WP website, your best bet is to move the completed WP website to root. It is possible to instead keep it in a subdirectory and use redirects, but redirects do add to server load.
Please refer to https://codex.www.ads-software.com/Moving_WordPress for step-by-step instructions.
Forum: Fixing WordPress
In reply to: plugins, themes and multisite securityHi Paul, head over to https://www.ads-software.com/support/forum/multisite with your question. More likely to get good advice from Ipstenu, the multisite guru.