-
AuthorPosts
-
October 15, 2024 at 7:54 pm #1469183
Hello!
We have multiple sites using Enfold child themes. All sites are on the latest version of the theme and the latest WordPress. We have a main site/installation and the other sites are installed in subfolders — so all on the same domain and the same PHP.
A few days ago, one of smaller the sites (one in a subfolder) went down because the theme will not load. I worked with my webhost’s tech support and there’s no malware or anything strange. They suggested downgrading the PHP from 8.2.24 to 7.4.33. I did that and the smaller site came back up. But our main site went down, saying it needs PHP 8.0. (Meanwhile the other sites using the same theme version, WordPress version, and PHP all stayed up.)
So I reset the PHP to 8.2. Here’s where I’m at …
UP: https://www.ecpubliclibrary.info/ (needs PHP 8 or higher)
DOWN: https://www.ecpubliclibrary.info/friends/ (needs PHP 7.4)
UP: https://www.ecpubliclibrary.info/teens/ (works on all PHP)
UP: https://www.ecpubliclibrary.info/kids/ (works on all PHP)Any idea what’s happening and how to fix it?
– Mike
October 16, 2024 at 9:05 am #1469198Hey Mike,
Are you sure that it’s the theme which is causing the fatal error on the site which is down? If you need further help, then please share server error logs with us. Also, does the site work if you temporarily activate the parent theme? If so, then the problem is likely coming from your child theme.
Best regards,
RikardOctober 16, 2024 at 3:35 pm #1469243I think so?
I’m in recovery mode and on the themes page under “Broken Themes” it says “This theme failed to load properly and was paused within the admin backend.” If I click Resume, I see an error message: “Theme could not be resumed because it triggered a fatal error.”
I pasted the error log into the Private Content window.
The site still does not load when using the parent Enfold theme and anything higher than PHP 7.4.33
Thanks for your help!
October 16, 2024 at 5:48 pm #1469256Hi,
Thanks, but the log doesn’t seem to contain any server errors, if you have a log with only server errors then please share that instead. If you need further help, then please share FTP and WordPress login details in private.
Best regards,
RikardOctober 16, 2024 at 6:39 pm #1469264This reply has been marked as private.October 16, 2024 at 7:59 pm #1469268Hi,
Thanks for that. I can’t see that Enfold is installed under /friends/wp-content/themes. Where exactly is it located? If you rename the themes folder, then you should hopefully be able to access your site again.
Best regards,
RikardOctober 16, 2024 at 8:31 pm #1469270This reply has been marked as private.October 17, 2024 at 5:36 am #1469279Hi,
Thank you for the update.
The Enfold theme is missing from the /friends/wp-content/themes folder. Try manually uploading the theme to the specified directory.
Best regards,
IsmaelOctober 17, 2024 at 4:27 pm #1469319Before I go through that process…
However it’s set up now, it works when you downgrade the PHP. Maybe it’s using and older style child theme setup?
So even if I redo the child theme setup, won’t I still have the PHP problem?
October 17, 2024 at 7:27 pm #1469335Hi,
Thanks for the update. We can’t say if you are going to have problems or not, but if Enfold is causing problems on your site then it’s a bit strange that it’s not in the theme folder. As of now, we don’t even know which theme the site is actually running.
Best regards,
RikardOctober 18, 2024 at 8:52 pm #1469415I’m not sure where the theme folder is, either (I didn’t set it all up). But it works. When you downgrade the PHP, the site comes back, using our Enfold child theme.
Tech support at my webhost told me this setup is fine, it’s just an older method of doing it. Since the ecpubliclibrary.info//friends WordPress installation is in a subfolder of the main ecpubliclibrary.info installation, maybe the /friends site is using the main site’s files?
Note: We have two other sites at /kids and /teens — also running the same Enfold child theme, and they work no mater the PHP version being used. However, these sites are set up as you’d expect, with the full Enfold theme installed in each of their theme folders.
Note: when I switch to the basic WordPress twentytwentyfour theme on /friends, it works. It’s only when I activate the Enfold child or Enfold parent that the PHP version causes a problem.
When I down grade the PHP so /friends is restored, the main side goes down, but that is a plugin issue.
I’d be happy to re-setup the /friends site with the expected child theme set up. What’s the easiest way to do that?
Thanks!
– MikeOctober 19, 2024 at 11:26 am #1469426Hi,
Thanks for the update. I’m not sure how you are switching themes if the site in question is not accessible? The first step to helping you out would be to check which version of the theme you are running, as Enfold is fully compatible with PHP 8.x. A PHP upgrade should not cause any problems, unless it caused by something in a child theme or by a plugin.
Best regards,
RikardOctober 21, 2024 at 4:25 pm #1469563Hi!
I’m able to switch themes and check versions by downgrading the PHP temporarily. I can’t do that for long because it brings our main site down.
Using this method I verified that /friends is using the latest version of Enfold.
I also tested changing the theme to the default twentytwentyfour and when I upgrade the PHP to 8.x the site loads just fine. But when I change the theme back to our Enfold child theme, or the Enfold parent theme, the site breaks and I need to go into recovery mode.
Like I said, I’m not sure why the child theme set up for /friends works, but it does. I’m assuming it’s an older method. But maybe that’s the trouble. If you know an easy way to re-setup the child theme, I’ll try it.
Again, thank you so much.
– Mike
October 22, 2024 at 6:42 am #1469587Hi,
Thank you for the info.
Try to go to the Tools > Site Health panel (wp-admin/site-health.php?tab=debug), then check for the Theme Directory Location in the Info > Active Theme panel. Also, try to check the wp-config.php file and look for these constants:
define('WP_CONTENT_DIR', dirname(__FILE__) . '/custom-content'); // Change 'custom-content' to your desired folder name define('WP_CONTENT_URL', 'https://yourdomain.com/custom-content'); // Change to match the new URL define('WP_THEME_DIR', WP_CONTENT_DIR . '/themes'); // New theme directory define('WP_THEME_URL', WP_CONTENT_URL . '/themes'); // New theme URL
The constants WP_THEME_DIR change the default theme directory, and WP_CONTENT_DIR changes the default wp-content folder. It’s possible that the previous developer adjusted these settings.
Best regards,
IsmaelOctober 22, 2024 at 6:36 pm #1469637Hello!
Hmmm. The config file for the /friends installation does not have those constants. I pasted the config file into the Private Content, along witht he child and parent theme paths…
October 23, 2024 at 5:56 am #1469652Hi,
also tested changing the theme to the default twentytwentyfour and when I upgrade the PHP to 8.x the site loads just fine. But when I change the theme back to our Enfold child theme, or the Enfold parent theme, the site breaks and I need to go into recovery mode.
When you try this, do you see any errors in the logs? Please set it up again, then check the error logs and let us know what you find.
Best regards,
IsmaelOctober 24, 2024 at 4:08 pm #1469770Hello!
I activated debug mode in the /friends wp-config.php file and then I changed the theme to twentrytwentytwo, and then I exited Recovery Mode. Then I activated out Enfold Child theme. But I can’t find the debug.log file anywhere. You have FTP access, are you able to locate it?
One new thing. Now when I activate the Enfold child, instead of just not loading, it showed me this:
Deprecated: Creation of dynamic property avia_sidebar::$title is deprecated in /home/customer/www/ecpubliclibrary.info/public_html/friends/wp-content/themes/assets/framework/php/class-sidebar-generator.php on line 34
Fatal error: Unparenthesized
a ? b : c ? d : e
is not supported. Use either(a ? b : c) ? d : e
ora ? b : (c ? d : e)
in /home/customer/www/ecpubliclibrary.info/public_html/friends/wp-content/themes/assets/functions-enfold.php on line 324
There has been a critical error on this website. Please check your site admin email inbox for instructions.Learn more about troubleshooting WordPress.
October 24, 2024 at 4:10 pm #1469771While doing all this, I also realized that this site is running an older version of the Enfold Parent. (4.x)
October 24, 2024 at 8:12 pm #1469796Now it shows…
Fatal error: Uncaught Error: Call to undefined function avia_get_option() in /home/customer/www/ecpubliclibrary.info/public_html/friends/wp-content/themes/assets/header.php:6 Stack trace: #0 /home/customer/www/ecpubliclibrary.info/public_html/friends/wp-includes/template.php(810): require_once() #1 /home/customer/www/ecpubliclibrary.info/public_html/friends/wp-includes/template.php(745): load_template(‘/home/customer/…’, true, Array) #2 /home/customer/www/ecpubliclibrary.info/public_html/friends/wp-includes/general-template.php(48): locate_template(Array, true, true, Array) #3 /home/customer/www/ecpubliclibrary.info/public_html/friends/wp-content/themes/assets/index.php(10): get_header() #4 /home/customer/www/ecpubliclibrary.info/public_html/friends/wp-includes/template-loader.php(106): include(‘/home/customer/…’) #5 /home/customer/www/ecpubliclibrary.info/public_html/friends/wp-blog-header.php(19): require_once(‘/home/customer/…’) #6 /home/customer/www/ecpubliclibrary.info/public_html/friends/index.php(17): require(‘/home/customer/…’) #7 {main} thrown in /home/customer/www/ecpubliclibrary.info/public_html/friends/wp-content/themes/assets/header.php on line 6
October 25, 2024 at 5:49 am #1469805Hi,
While doing all this, I also realized that this site is running an older version of the Enfold Parent. (4.x)
Have you tried removing the older version and updating the theme to version 6.0.6? Looks like you didn’t place the theme files in the correct folder.
friends/wp-content/themes/assets/header.php
The path should be:
friends/wp-content/themes/enfold/header.php
Best regards,
IsmaelOctober 25, 2024 at 4:53 pm #1469847Hi!
If you have a minute, can you scan over the messages I exchanged with Rikard? I didn’t set up this installation and it looks like it’s using an older method for parent/child themes. When I downgrade the PHP, the setup actually works just fine, and has for years.
That said, I’m happy to re-set it up and upgrade Enfold. But I’m not sure the best way to do that. Can you please walk me through that?
– Mike
October 25, 2024 at 5:49 pm #1469858Hey! Never mind, looks like a the upgrade did, indeed, fix things.
I copied the Enfold parent theme folder from a working site with the newest version and pasted it into the /friends themes folder. Then I renamed it “assets” and everything worked. I still have no idea why my predecessor set it up that way. If you don’t see any problems with doing it this way, I’ll just leave it.
Sorry this was so drawn out. Thanks for your time.
– Mike
October 26, 2024 at 9:17 pm #1469910Hi,
Thanks for the update. Please let us know if you should need any further help on the topic, or if we can close it.
Best regards,
RikardOctober 28, 2024 at 2:26 pm #1470008Thanks so much. Please close.
-
AuthorPosts
- The topic ‘Funky PHP Trouble’ is closed to new replies.