Why do I get a"previously declared in" error - php

Jus tried to log in to my web admin and got this error:
Fatal error: Cannot redeclare oceanwp_webfonts_enqueue() (previously declared in /home/customer/www/ozdistributorsusa.com/public_html/wp-content/plugins/ocean-extra/includes/compatibility/ocean.php:94) in /home/customer/www/ozdistributorsusa.com/public_html/wp-content/themes/oceanwp/inc/customizer/controls/typography/webfonts.php on line 128
I can't get acces to the actual site either, any suggestions?

To fix it I manually commented the following functions in /wp-content/plugins/ocean-extra/includes/compatibility/ocean.php:
oceanwp_webfonts_enqueue()
ocean_get_google_font_css()
oceanwp_get_local_webfonts_data_dir()
oceanwp_get_local_webfonts_css_data_dir()
It was a "bad" update, which is now already fixed in 2.0.4 (https://wordpress.org/plugins/ocean-extra/#developers)
After commenting you can update that plugin via the panel or alternatively you can manually update it by removing the folder /wp-content/plugins/ocean-extra/ and uploading again the plugin.

I had the same problem, I got access by changing the theme via in the Database (VIA PHPmyAdmin) for one of the ones that comes by default (like twentytwenty).
I installed a new theme but the whole thing seems unstable still. If nothing better comes up I'm starting a fresh install.

oceanwp_webfonts_enqueue() function declare more than one. this function may be used in loop.

Related

Magento Fatal Error: Class 'Zend_Log' not found

With a module I added an custom customer attribute.
When a client is logged in and want to edit their account information or want to change their password on frontend the following error comes up:
Fatal error: Class 'Zend_Log' not found in /app/code/community/Amar/Profile/Model/Customer/Attribute.php on line 49
I build this website local and uploaded it to the server.
On the local environment this error is not showing up, this error only showing up on the server.
I think it has to do something with file permissions.
Does anyone have a solution for this?
the problem has been solved.
On the live server there was another PHP version which was not compatible with the extension.
For me a function loadByCode() causes the issue, I have renamed it and it is working fine. We should not use generic method names in custom modules.
The function is in \app\code\community\Amar\Profile\Model\Customer\Attribute.php file.

Drupal/Wordpress Fatal error: Cannot redeclare functions - Errors keep showing

I have a drupal site and inside i have a wordpress blog like that drupal_site/wordpress_blog.
When i did the implantation all seemed to work fine but now i am getting the following error
Fatal error: Cannot redeclare timer_start() (previously declared in (path_of_mysite)/includes/bootstrap.inc:456) in (path_of_mysite)/blog/wp-includes/load.php on line 197
I have renamed the timer_start() but then i got another same error for another function.
So the problem is that drupal's functions "overrides" wp functions and renaming every wp core function not working.
Also i have tried at least the errors to not shown at my page, i have disable them from my drupal dashboard, i have tried via .htaccess,via index.php,also via phpmyadmin but this error keeps showing.
Update:I found the solution for the errors to not be shown,i just have added
error_reporting(0);
to wp-config.php.So at least there is something.
Any clue for the solution?
Drupal and Wordpress are trying to declare the same function names. To solve this type of problems PHP had introduced namespaces in PHP 5.3, more info: http://www.php.net/manual/en/language.namespaces.php, but saddly Drupal and Wordpress did not use namespaces.
My recomendation to avoid this problem is to install Drupal and Wordpress in different subdomains, so if your domain is drupal_site.com, use blog.drupal_site.com for Wordpress installation.

yii cannot access gii - clogrouter error

I have just installed YII without any problems, but I cannot get into GII. I have uncommented the specific lines in mywebapp/protected/config/main.php to enable GII.
When I try to go to: localhost/myapp/index.php?r=gii I am redirected to localhost/myapp/index.php?r=gii/default/login.
I don't have the URL manager enabled it is a fresh installation on Wamp.
The error I get is this:
Fatal error: Cannot redeclare class CLogRouter in C:\wamp\www\yii\framework\logging\CLogRouter.php on line 53
The yii folder is the installation folder (did not know that the app is still using it).
What could be causing the trouble and how to get GII working? Thanks for your replies!
It is not clear what your problem is.
Getting redirected to /gii/default/login is good. This is where you log in with a password.
Your error "Cannot redeclare class CLogRouter" indicates that you are declaring CLogRouter twice. This probably happens in your protected/config/main.php.
However, I am under the impression that this error is not related to gii. Why don't your turn logging off (for now)?

Can no longer install WordPress on MAMP- "Fatal error: Cannot redeclare class wpdb"

I've been developing WordPress sites for a long time on my local MAMP server. Now all of a sudden, it won't let me create any new sites. Whenever I set up a new one, instead of running the install script I get:
Fatal error: Cannot redeclare class
wpdb in
/Applications/MAMP/htdocs/[my_site]/wp-includes/wp-db.php
on line 52
This happens with all WordPress versions. I cannot thing of anything that would have caused this. I've done everything short of re-install MAMP. Does anyone have any ideas? I'm desperate at this point..
Check out the include path for php. It's likely that a second instance of wordpress is on the include path and is therefore conflicting with the one you're trying to load. It's also possible that a different package on the include path has a class called wpdb and is therefore causing a conflict.
wpdb is being created again some where, if this happened all of a sudden i suggest that you disable any plugins you've recently added. Or even better do a global find for the term class wpdb and see if that appears within more than 1 file. Also, check your functions.php file for a loop that might be loading wp-db.php more than once.
A workaround fix is to wrap the wpdp class in wp-includes/wp-db.php in the following:
Line 52:
if(class_exists('wpdb') != true)
{
class wpdb {
...
}
}
This solved the install issue- You could probably remove it after that, although it can't hurt to leave it I guess.
Still don't understand why this problem has popped up- If someone has an explanation I'd be eager to hear it.

Magento 1.3.3 error at showing checkout shoppin cart

As soon as I try to add a product to the shopping cart in Magento, it spits this PHP error:
Fatal error: Call to undefined method Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection::addTierPriceData()
I don't know what is it about; I've tried the Magento forum and I haven't yet found out a solution to this.
I installed magento through SimpleScripts.com, in a hostmonster.com account. My store is still waiting to launch due to this strange error(www.caninarua.com/shop). I really don't know what to do now...please help.
Thanks.
There's nothing in the default v1.3.2.4 Magento codebase that calls addTierPriceData() on that class. It does, however, exist in v1.4.2 and is called by Mage_Bundle_Model_Product_Price::getFinalPrice()
So, either you have a commercial theme that is calling that function (unlikely), or an extension that has been installed that is not compatible with v1.3.3
If you turn on logging in System>Config>Admin>Developer, you should get a full stack trace in var\log\exception.log which you can paste into your question and we can verify which piece of code is calling that method.

Categories