Error Loading Zend Gdata framework into Wordpress - wordpress

I am trying to use the Zend Gdata framework with wordpress but I am having some issues.
Now everything works perfectly fine when I test on localhost with XAMPP. However on my web server my code breaks down.
Here is my code to include the framework.
`set_include_path(TEMPLATEPATH . '/includes/');
require_once ('Zend/Loader.php');
Zend_Loader::loadClass('Zend_Gdata_Youtube');`
That code produces the following error.
Warning: Zend_Loader::include_once(Zend/Gdata/Youtube.php) [zend-loader.include-once]: failed to open stream: No such file or directory in /home/damain/public_html/mysite.com/wp-content/themes/mysite/includes/Zend/Loader.php on line 146
Warning: Zend_Loader::include_once() [function.include]: Failed opening 'Zend/Gdata/Youtube.php' for inclusion (include_path='/home/damain/public_html/mysite.com/wp-content/themes/mysite/includes/') in /home/damain/public_html/mysite.com/wp-content/themes/mysite/includes/Zend/Loader.php on line 146
Fatal error: Uncaught exception 'Zend_Exception' with message 'File "Zend/Gdata/Youtube.php" does not exist or class "Zend_Gdata_Youtube" was not found in the file' in /home/damain/public_html/mysite.com/wp-content/themes/mysite/includes/Zend/Loader.php:99 Stack trace: #0 /home/damain/public_html/mysite.com/wp-content/themes/mysite/includes/modules/yt_link_checker.php(19): Zend_Loader::loadClass('Zend_Gdata_Yout...') #1 /home/damain/public_html/mysite.com/wp-includes/plugin.php(405): load_zend_gdata('') #2 /home/damain/public_html/mysite.com/wp-admin/admin.php(111): do_action('load_zend_gdata', Array) #3 /home/damain/public_html/mysite.com/wp-admin/index.php(10): require_once('/home/damain/...') #4 {main} thrown in /home/damain/public_html/mysite.com/wp-content/themes/mysite/includes/Zend/Loader.php on line 99
I cannot seem to figure this issue out. Can anyone help?

The best solution in this case is to run the script requiring the Zend Loader and use var_dump(get_include_path()) to see what the server says the path is. Then keep modifying the php.ini include_path until the script finds it.
In your case, I'm not sure if 'damain' is supposed to be 'domain'. My include path which finally worked was:
/home2/thelove6/public_html/zf/ZendGdata/library" thelove6 being the username.

Did you look to see if those files exist in those directories? (/mysite/includes/Zend/Loader.php) and they have the correct permissions? It sounds like that could very well be the issue. The other thing to check with a simple phpinfo() would be that you have all of the libraries install on the live server.

Ok, the possible reason is: You're not using the proper case for the classname. For the version 1.11.11, it will be Zend_Gdata_YouTube rather than Zend_Gdata_Youtube.
Windows OS is ignoring the case, whereas the Linux server does not. Hope this will solve your problem, just look at the proper case of the Class or filenames.

Related

Can't enter in my wordpress localhost, getting errors because of custom plugin

I uploaded custom plugin in my wordpress localhost,
after I activated it I've got an error:
Fatal error: Cannot redeclare true_plugins_activate() (previously declared in /Applications/MAMP/htdocs/wordpress/wp-includes/functions.php:7406) in /Applications/MAMP/htdocs/wordpress/wp-includes/functions.php on line 7465
Fatal error: Uncaught Error: Call to undefined function wp_kses_normalize_entities() in /Applications/MAMP/htdocs/wordpress/wp-includes/formatting.php:4333 Stack trace: #0 /Applications/MAMP/htdocs/wordpress/wp-includes/class-wp-fatal-error-handler.php(190): esc_url('https://wordpre...') #1 /Applications/MAMP/htdocs/wordpress/wp-includes/class-wp-fatal-error-handler.php(147): WP_Fatal_Error_Handler->display_default_error_template(Array, false) #2 /Applications/MAMP/htdocs/wordpress/wp-includes/class-wp-fatal-error-handler.php(52): WP_Fatal_Error_Handler->display_error_template(Array, false) #3 [internal function]: WP_Fatal_Error_Handler->handle() #4 {main} thrown in /Applications/MAMP/htdocs/wordpress/wp-includes/formatting.php on line 4333
Then I deleted this plugin, but anyway I can't enter because of this errors.
I tried to rename plugins folder to plugins_old, plugins.deactivate and etc., but nothing.
Also I entered inside phpmyadmin in options and active_plugins and replace everything with this a:0:{}, but nothing changed.
Can you help me, please?
So we discussed the issue somewhat in the question comments (this is the most important note for context)
Whatever happened here is a reflection of a corrupted WordPress install, not a plugin (even if this was the trigger). People have got these errors when upgrading WordPress or PHP [...] [but] I don't think that [true_plugins_activate] function should even be there once.
Someone also had this problem due to installing a plugin called "Monitization", which was malware.
So I'll say what I'd do in this situation.
I would open the functions.php file (in the folder wp-includes) in a text editor, search for "true_plugins_activate" and look inside the contents for any PHP files I didn't recognise. This would only give me information as to whether something unfamiliar (like malware in the plugin with a different name) was involved, but it's clear you know which plugin caused this.
Then, I would reinstall the wordpress files that are corrupted. I would find the version of WordPress that I had installed, then I would download the zip file from https://wordpress.org/download/releases/, extract it, then first copy the two files that show in the error, replacing the originals in wp-includes. I would check if this fixes the problem. Even if it does, I would most likely copy over all the other files. (I might move any plugins or themes I had installed to a separate location, so that they don't get overwritten.)
If I was feeling very investigative, before copying, I would do a diff check of my entire WordPress installation with the WordPress download to see exactly what files were different and how. There are many programs that can do this.
You said that everything was fine after removing both "true_plugins_activate"s, but I would not come to this conclusion so fast, because there was another error in the log that affected a totally different file, wp-includes/formatting.php. I would definitely reinstall multiple or all WordPress files after this.

Aptana returns "Malformed \uxxxx encoding." when debugging with PHP 5.4.x

When I try to debug or run a PHP script on my test Windows server using Aptana and PHP 5.4.24 (or the latest 5.4.x, 5.4.40), I am told "Malformed \uxxxx encoding" has occurred.
Given most material online about this error (with any Java code) refers to paths, I've tried installing this PHP version in two locations (and with an additionally different path), with no change. None of the paths contain the string "\u".
If I use PHP 5.5.12 instead, there's no error.
My production server uses 5.4.24, and I would prefer to leave it the way it is for the time being. I would like to debug using the same version of PHP.
A certain Igor appears to have had the same problem as me in July 2014: http://php.tutorialhorizon.com/how-to-debug-php-in-aptana-studio/#comment-2225
The offered solution "check your paths" hasn't helped me.
Log:
ENTRY org.eclipse.core.jobs 4 2 2015-04-21 13:44:19.026
!MESSAGE An internal error occurred during: "Launching website".
!STACK 0
java.lang.IllegalArgumentException: Malformed \uxxxx encoding.
at java.util.Properties.loadConvert(Unknown Source)
at java.util.Properties.load0(Unknown Source)
at java.util.Properties.load(Unknown Source)
at org2.eclipse.php.internal.debug.core.launching.XDebugExeLaunchConfigurationDelegate.isXDebugFunctional(XDebugExeLaunchConfigurationDelegate.java:310)
at org2.eclipse.php.internal.debug.core.launching.XDebugExeLaunchConfigurationDelegate.launch(XDebugExeLaunchConfigurationDelegate.java:86)
at org2.eclipse.php.internal.debug.core.launching.PHPLaunchDelegateProxy.launch(PHPLaunchDelegateProxy.java:71)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:858)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:707)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1018)
at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1222)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Look at the property file or the file displayed in the error message and change the backslash to forwardslash:
...\user_projects... to .../user_projects...
Or
...\uxxxx... to .../uxxxx...
\u is a reserved keyword and throws the system off.
Note: "..." and "xxxx" are depicting anything in this case. Usually the error displays a line number one line below the actual line with the issue or so-called ...\u...
Reference: http://bugs.java.com/bugdatabase/view_bug.do?bug_id=6555979
It is really disappointing that so many of these issues with java plague many of us and so many articles send people on a wild goose chase. Hope this helps someone.
Are there paths with /usr in them somewhere? The windows version of PHP can do odd things with slashes and backslashes. Without seeing your config it is hard to say.

Conversion error: Jekyll::Converters::Scss encountered an error

I downloaded the new material bootstrap css and wanted to use it in my jekyll blog. After setting up and running the jekyll serve -w to compile the site locally, the console returned this error
Conversion error: Jekyll::Converters::Scss encountered an error while converting 'css/main.scss': Invalid CSS after "...x-highlighting"": expected selector or at-rule, was ""bootstrap"" on line 49
After searching for a while, it seems as if I am the only one facing this issue. What am I doing wrong?
Turns out this was caused by an omitted comma after one of my import statements
#import
"base",
"layout",
"syntax-highlighting",
"bootstrap";
Hope this saves someone else some time.
You can also check if you're starting the server in the right directory, in my case, I spend 1 hour trying to start the server in the wrong directory :(
This error is usually thrown when there is a typo or malformed CSS string in one of the *.sass files.
The error returned during the build is pointing to the issue. Just have in mind that the given line in the error is the one in bundled output css file: _site/css/main.css.
Using --trace might help further investigate in some cases. i.e.:
bundle exec jekyll build --trace
In github Pages, set main folder to /(root), not docs. Hope it works

Symfony 2 Missing File Error When They're Not

I got my Symfony 2.3 project working through app.php in development. I then did a complete copy to my shared host sever (goDaddy). So far, all I get are blank pages. I've been working my way through the errors. My lastest execution generates 100+ errors in the php log of this type:
[09-Jul-2013 12:52:56 America/Los_Angeles] PHP Warning: file_get_contents(/Volumes/Data RAID/htdocs/Symfony/src/Zetcho/AmColAnBundle/Resources/views/User/userSubNav.html.twig) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: No such file or directory in /home/content/.../Symfony/vendor/symfony/symfony/src/Symfony/Component/Templating/Storage/FileStorage.php on line 32
Then I get one of theses
[09-Jul-2013 12:52:56 America/Los_Angeles] PHP Warning: file_get_contents(/Volumes/Data RAID/htdocs/Symfony/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception_full.html.twig) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: No such file or directory in /home/content/.../Symfony/vendor/twig/twig/lib/Twig/Loader/Filesystem.php on line 127
The ellipses are mine. I verified that the file that both files were was at the locations specified and that I could read it. The permissions on the files are 644. Could this be a permission problem? If so, what should they be set to?
Update: I set the permissions to 755 and got the same errors.
Update 2: I just noticed that the error is giving my development server directory path. Now I just have to figure out where to change it.
Update 3: It appears to be the cache. There is not command access to a goDaddy shared server that I know of so I just deleted all the files in app/cache/prod. I now get my html, but no css. I use Assetic for images and css. I get the images.
Update 4: When I clicked on a link, the next page used the css file. When I went back to the first page, it used it as well. As I check out the pages, some of the images are missing. Could this be because the cache wasn't rebuilt correctly or completely?
Update 5: Fixed the last problem with missing images. There was a case mismatch between the reference and the image. I think I'm good now.

Wordpress error after upgrade "cannot redeclare" + "eval()'d"

Getting this error after a forced wordpress upload (I was working in the database when at one point of time I got an alert - while on the backend, with only one option to upgrade to the newer available version):
Fatal error: Cannot redeclare _421736532() (previously declared in /home/user/domains/mydomain.com/public_html/wp-content/themes/twentyelevenmodified/header.php(68) : eval()'d code:1) in /home/user/domains/mydomain.com/public_html/wp-content/themes/twentyelevenmodified/header.php(68) : eval()'d code on line 1
The above is when I try mydomain.com
When I try mydomain.com/wp-admin/, I am redirected to wp-login.php and getting the following error:
Fatal error: Cannot redeclare _421736532() (previously declared in /home/user/domains/mydomain.com/public_html/wp-login.php(80) : eval()'d code:1) in /home/user/domains/mydomain.com/public_html/wp-login.php(80) : eval()'d code on line 1
Pulling my hair out trying different things since 5 hours now. Any help will be appreciated.
EDIT: After testing, I found that the function.php file is correctly calling function twentyeleven_header_style() and the problem is coming just after calling this function. So it's the next function call that is causing the problem. If I could know what is the next function !!!
Wordpress doesn't use functions with those names. Deactivate your plugins or rename the plugins folder.
If that doesn't work then it's probably coming from your theme. Rename your theme folder so wordpress will revert to the default (assuming the default theme exists).
It sounds like you purchased a theme or plugin with obfuscated code and it's using eval() to run it and probably making a call home.
After much research, I found that the site in question was hacked. More than 100 files were corrupted with codes. I cleaned them all and now things are functioning.
For others facing the same problem, download the whole files to your computer and look for eval codes (can be easily recognized).

Resources