Unexpected error when installing WordPress plugins - php

I was installing civicrm and got an error while trying to install some wp plugin.
When trying to do it manually, I got the same error. It's been reported by others that this should work.
It happens for all plugins that I'm trying to install
I'm unable to figure out what could be wrong. I tried upgrading openssl and php5-curl as I read that online in some forum. Restarting apache didn't help either.
When I go to the "install plugin" page I get the same errors. Changing the timeout in wp-admin/includes/plugin-install.php for the function wp_remote_post() from 15 to 60 made it work. But that's not good as it's a core file. Also, themes dont work if I do this.
ajk#ajk-ThinkPad-R60:~/buildkit/build/wpmaster/wp-content/plugins$ wp plugin install civicrm-admin-utilities --debug
Debug: No readable global config found (0.029s)
Debug: Using project config: /home/ajk/Documents/civi/civicrm-buildkit/build/wpmaster/wp-cli.yml (0.034s)
Debug: ABSPATH defined: /home/ajk/Documents/civi/civicrm-buildkit/build/wpmaster/ (0.121s)
Debug: Begin WordPress load (0.121s)
Debug: wp-config.php path: /home/ajk/Documents/civi/civicrm-buildkit/build/wpmaster/wp-config.php (0.122s)
Debug: Loaded WordPress (0.724s)
Debug: Running command: plugin install (0.725s)
PHP Notice: An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the support forums. (WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.) in /home/ajk/Documents/civi/civicrm-buildkit/build/wpmaster/wp-admin/includes/plugin-install.php on line 158
PHP Stack trace:
PHP 1. {main}() /home/ajk/Documents/civi/civicrm-buildkit/bin/wp:0
PHP 2. include() /home/ajk/Documents/civi/civicrm-buildkit/bin/wp:4
PHP 3. include() phar:///home/ajk/Documents/civi/civicrm-buildkit/bin/wp/php/boot-phar.php:5
PHP 4. WP_CLI\Runner->start() phar:///home/ajk/Documents/civi/civicrm-buildkit/bin/wp/php/wp-cli.php:21
PHP 5. WP_CLI\Runner->_run_command() phar:///home/ajk/Documents/civi/civicrm-buildkit/bin/wp/php/WP_CLI/Runner.php:723
PHP 6. WP_CLI\Runner->run_command() phar:///home/ajk/Documents/civi/civicrm-buildkit/bin/wp/php/WP_CLI/Runner.php:320
PHP 7. WP_CLI\Dispatcher\Subcommand->invoke() phar:///home/ajk/Documents/civi/civicrm-buildkit/bin/wp/php/WP_CLI/Runner.php:313
PHP 8. call_user_func() phar:///home/ajk/Documents/civi/civicrm-buildkit/bin/wp/php/WP_CLI/Dispatcher/Subcommand.php:294
PHP 9. WP_CLI\Dispatcher\CommandFactory::WP_CLI\Dispatcher\{closure}() phar:///home/ajk/Documents/civi/civicrm-buildkit/bin/wp/php/WP_CLI/Dispatcher/Subcommand.php:294
PHP 10. call_user_func() phar:///home/ajk/Documents/civi/civicrm-buildkit/bin/wp/php/WP_CLI/Dispatcher/CommandFactory.php:52
PHP 11. Plugin_Command->install() phar:///home/ajk/Documents/civi/civicrm-buildkit/bin/wp/php/WP_CLI/Dispatcher/CommandFactory.php:52
PHP 12. WP_CLI\CommandWithUpgrade->install() phar:///home/ajk/Documents/civi/civicrm-buildkit/bin/wp/php/commands/plugin.php:445
PHP 13. Plugin_Command->install_from_repo() phar:///home/ajk/Documents/civi/civicrm-buildkit/bin/wp/php/WP_CLI/CommandWithUpgrade.php:141
PHP 14. plugins_api() phar:///home/ajk/Documents/civi/civicrm-buildkit/bin/wp/php/commands/plugin.php:297
PHP 15. trigger_error() /home/ajk/Documents/civi/civicrm-buildkit/build/wpmaster/wp-admin/includes/plugin-install.php:158
Warning: civicrm-admin-utilities: An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the support forums.

Related

PHPOffice: PHP Fatal error: Interface 'Psr\SimpleCache\CacheInterface' not found

I have custom WordPress plugin where I giving option for admins to download export of survey. The plugin using package phpoffice
I have test hosting with PHP 7.3 where export goes well and the production hosting is on PHP 7.3.3 (before it was PHP 7.4) where the exactly same problem does not work.
I'm expecting to resolve this error and make the option for download exports working..
I've tried searching for google but I didn't find solution exactly for my problem.
I tried this stuffs:
Upgrade memory_limit from 256MB to 512MB
Tried to downgrade production hosting PHP version from 7.4 to 7.3.3
When production hosting PHP version was 7.4 it gived this error in PHP error log:
[22-Dec-2022 08:45:24 UTC] PHP Fatal error: Uncaught Error: Interface 'Psr\SimpleCache\CacheInterface' not found in /www/doc/www.digitalniagora.cz/www/wp-content/plugins/agora_survey/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Collection/Memory.php:14
Stack trace:
#0 /www/doc/www.digitalniagora.cz/www/wp-content/plugins/agora_survey/vendor/composer/ClassLoader.php(571): include()
#1 /www/doc/www.digitalniagora.cz/www/wp-content/plugins/agora_survey/vendor/composer/ClassLoader.php(428): Composer\Autoload\includeFile('/www/doc/www.di...')
#2 [internal function]: Composer\Autoload\ClassLoader->loadClass('PhpOffice\\PhpSp...')
#3 /www/doc/www.digitalniagora.cz/www/wp-content/plugins/agora_survey/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Settings.php(164): spl_autoload_call('PhpOffice\\PhpSp...')
#4 /www/doc/www.digitalniagora.cz/www/wp-content/plugins/agora_survey/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Collection/CellsFactory.php(19): PhpOffice\PhpSpreadsheet\Settings::getCache()
#5 /www/doc/www.digitalniagora.cz/www/wp-content/ in /www/doc/www.digitalniagora.cz/www/wp-content/plugins/agora_survey/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Collection/Memory.php on line 14
After I downgraded the PHP version to 7.3.3 (because I haven't option to downgrade to PHP 7.3) I getting just this error:
[27-Dec-2022 15:43:23 UTC] PHP Fatal error: Interface 'Psr\SimpleCache\CacheInterface' not found in /www/doc/www.digitalniagora.cz/www/wp-content/plugins/agora_survey/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Collection/Memory.php on line 14
EDIT 29.12.2022:
I tried update PHP version on test hosting to the same version as production hosting is but on test version it working well and production version code does not work.
But the code is exactly same as on test hosting where everything works well and also the code is exactly same after downgrade PHP version..
Can anybody give me some hints to find the solution?

Fatal Error: Call to undefined function gzopen() when installing WordPress theme

I'm seeing the below error after attempting to activate a WordPress theme. The error message in the browser is...
Fatal error: Call to undefined function gzopen() in /var/www/mysite.com/wp-content/themes/flat/themify/themify-builder/classes/class-themify-builder-layouts.php on line 528
Checking my /var/log/apache2/error.log I see the following error:
Call to undefined function gzopen() in /var/www/mywebsite.com/wp- content/themes/flat/themify/themify-builder/classes/class-themify-builder-layouts.php on line 528, referer: http://mywebsite.com/wp-admin/update.php?action=upload-theme
Server information:
OS: Ubuntu 14.04 LTS
Apache: APache/2.4.7
PHP: PHP 5.5.9-1ubuntu4
That happened with me too (after upgrading to 14.04 #ubuntu). I waisted my whole day on it but in the end i found the solution.
replace gzopen with gzopen64.
this absolutely worked for me.
PS: I'll like the magento community to know that this problems appeared in creating package, after upgrading apache and php.
This issue occurs because your PHP server is not compiled with Zlib (this PHP module allows you to read and write .gz compressed files). Zlib support in PHP is not enabled by default.
More information about how to setup Zlip can be found here: http://php.net/manual/en/zlib.setup.php

Installing Symfony 2.5: blank welcome page | apc_cache_find notice

I'm trying to install Symfony2 (I use 'Bitnami' localhost on Windows). When I open http://localhost:8080/symfony2/web/config.php I see the config page, after goint to welcome page blank page is displayed.
On http://localhost:8080/symfony2/web/app_dev.php I've turned ini_set("display_errors", "1"); and what I get is:
Notice: require_once(): 1.
h->opened_path=[C:\Bitnami\wampstack-5.4.26-0\apache2\htdocs\symfony2\app\bootstrap.php.cache]
h->filename=[C:\Bitnami\wampstack-5.4.26-0\apache2\htdocs\symfony2\app\bootstrap.php.cache]
in
C:\Bitnami\wampstack-5.4.26-0\apache2\htdocs\symfony2\web\app_dev.php
on line 27
Notice: require_once(): apc_cache_find [-1630956134] in
C:\Bitnami\wampstack-5.4.26-0\apache2\htdocs\symfony2\web\app_dev.php
on line 27
Notice: require_once(): 1.
h->opened_path=[C:\Bitnami\wampstack-5.4.26-0\apache2\htdocs\symfony2\app\autoload.php]
h->filename=[C:\Bitnami\wampstack-5.4.26-0\apache2\htdocs\symfony2\app\autoload.php]
in
C:\Bitnami\wampstack-5.4.26-0\apache2\htdocs\symfony2\app\bootstrap.php.cache
on line 3
And further errors similar to these.
I saw this: APC (Alternate PHP Cache) Throwing Lots of PHP Notices
But I'm not sure what should I do with Enable internal debugging in APC [no] :no
I'm stuck. What should I do next?
As far as I know there is currently no APC module for PHP5.5 on Windows so you have to use another cache module. You did not write which Xampp version you are using, but I suppose a more recent one.
Please try to use APCu and enable it in php.ini
extension = "C:\xampp\php\ext\php_apcu.dll"
apc.enabled = 1
It worked for me on Windows.
Also, Zend released in PHP5.5 their new OPCache as an alternative to APC. More info can be found here enter link description here. Could be also useful but I never tried that one.

Trouble running local WordPress in Google App Engine

Following these instructions.
Installed MySQL, Python and Google App Engine PHP SDK on a Windows 8 PC. Perfect!
Created an app for WordPress, created database and user on localhost and edited WordPress config accordingly.
Started the app in the Google App Engine Launcher. Clicking Browse leads to blank page at http://localhost:8080/
Hmmm...
Checked logs, found
2013-11-26 17:56:18 Running command: "['C:\\Python27\\python.exe',
'C:\\Program Files (x86)\\Google\\google_appengine\\dev_appserver.py',
'--skip_sdk_update_check=yes', '--port=8080', '--admin_port=8000',
'C:\\Users\\CsillamVilag\\Documents\\development-appengine\\arcfestesmintak']"
INFO 2013-11-26 17:56:19,805 devappserver2.py:660]
Skipping SDK update check.
WARNING 2013-11-26 17:56:19,813 api_server.py:331]
Could not initialize images API; you are likely missing the Python "PIL" module.
INFO 2013-11-26 17:56:19,822 api_server.py:138]
Starting API server at: http://localhost:53853
INFO 2013-11-26 17:56:19,826 dispatcher.py:171]
Starting module "default" running at: http://localhost:8080
INFO 2013-11-26 17:56:19,828 admin_server.py:117]
Starting admin server at: http://localhost:8000
INFO 2013-11-26 17:56:21,828 module.py:617] default: "GET / HTTP/1.1" 302 -
Pretty certain the Python for Windows package I used included PIL. Not sure where to go from here...
If I go to http://localhost:8080/wp-admin though, I get
Warning: chdir(): Invalid argument (errno 22) in C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\devappserver2\php\setup.php on line 42
Warning: require(wordpress/wp-admin/wp-admin/install.php): failed to open stream: No such file or directory in C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\devappserver2\php\setup.php on line 103
Fatal error: require(): Failed opening required 'wordpress/wp-admin/wp-admin/install.php' (include_path='C:\Users\CsillamVilag\Documents\development-appengine\arcfestesmintak;C:\Program Files (x86)\Google\google_appengine\php\sdk') in C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\devappserver2\php\setup.php on line 103
In the error returned at http://localhost:8080/wp-admin/ I see /wp-admin/wp-admin/install.php
Obviously install.php cant be found. It is in /wp-admin/ not in /wp-admin/wp-admin/
Not sure how to fix that.
If you are getting a blank page, you'll want to check your errors
In your /wordpress/wp_config.php file set
define('WP_DEBUG', false);
#ini_set('display_errors',0);
to
define('WP_DEBUG', true);
#ini_set('display_errors',1);
and see what is output when you go to
http://localhost:8080
Looks like Google App Engine doesn't support WordPress 3.7.1 (something that's not documented anywhere). Downgrading to WordPress 3.5.1 (the version mentioned in Google's instructions) made it work - http://localhost:8080 was forwarded to WordPress Install page.

Strange error trying to execute "php codecept.phar run > result.txt"

I have installed Codeception following the guide on their website. Everything went okay, so I created my first basic test.
<?php
$I = new WebGuy($scenario);
$I->wantTo('ensure that frontpage works');
$I->amOnPage('/');
$I->see('Homepage');
Trying to execute this and it gave Stack trace errors so I dumped them in result.txt page.
Codeception PHP Testing Framework v1.6.2
Powered by PHPUnit 3.7.19 by Sebastian Bergmann.
Notice: Use of undefined constant CURLOPT_SSL_VERIFYPEER - assumed 'CURLOPT_SSL_VERIFYPEER' in phar://C:/wamp/www/dugun/codecept.phar/src/Codeception/Configuration.php on line 175
Notice: Use of undefined constant CURLOPT_CERTINFO - assumed 'CURLOPT_CERTINFO' in phar://C:/wamp/www/dugun/codecept.phar/src/Codeception/Configuration.php on line 175
Notice: Use of undefined constant CURLOPT_SSL_VERIFYPEER - assumed 'CURLOPT_SSL_VERIFYPEER' in phar://C:/wamp/www/dugun/codecept.phar/src/Codeception/Module/PhpBrowser.php on line 78
Fatal error: Call to undefined function Guzzle\Http\Curl\curl_version() in phar://C:/wamp/www/dugun/codecept.phar/vendor/guzzle/guzzle/src/Guzzle/Http/Curl/CurlVersion.php on line 47
Using WAMP on Windows 7. PHP ver 5.4.3. Apache ver 2.4.2. CURL is enabled in settings. Tried restarting several times, no luck.
Anyone knows how to solve this issue, what may be wrong?
Update
The problem was related to curl.dll. Downloading a fresh one from this topic (PHP cURL not working - WAMP on Windows 7 64 bit) solved the issue.
Based on the errors I'd guess that CURL is missing even though it's enabled, try running a phpinfo() to see if the extension is running.
From the PHP site:
"Note: Note to Win32 Users
In order to enable this module on a Windows environment, libeay32.dll and ssleay32.dll must be present in your PATH. You don't need libcurl.dll from the cURL site."
http://www.php.net/manual/en/curl.installation.php

Categories