i just build a wordpress site and use lasted version 4.8.3
i want to use python-wordpress-xmlrpc module, one year ago i use this is work
but ,when i use QuickStart guide to try connect my wordpress,It Get erorr
i google two day but,not have any ans, i found a issued on module creator git-hub
https://github.com/maxcutler/python-wordpress-xmlrpc/issues/110
Look like some people have same error.
that is my code
host = 'http://sample.com'
wp = Client(host+'/xmlrpc.php', 'root', 'password')
print(wp)
r = wp.call(GetPosts())
#Error MEssage xmlrpc.client.Fault: <Fault -32700: 'parse error. not well formed'>
I think maybe is wordpress 4.8 on php7 environment will get error.
have any one can tell me how to fix this problem?
My experience with the -32700 error showed up when trying to use python 3, wordpress REST API and wordpress_xmlrpc python package.
When using the REST API the read functions all worked with pycurl. However, the authentication was a problem.
I moved to using wordpress_xmlrpc to solve the logon/handshake method. This worked well with my development/test wordpress instance but failed miserably when I moved to the QA site (fully copy of production).
In QA I kept receiving a -32700 xmlrpc python wordpress parse error. Very specific message with no real insight into what caused the problem. Searching "-32700 xmlrpc wordpress rest api python" gave many results, but few that actually helped. After trying numerous things here is the what actually helped.
Turn on Debugging in WordPress.
In wp-config.php there was a line:
define('WP_DEBUG', false);
To turn on debugging you need to change this to:
define('WP_DEBUG', true);
and then add the line:
define('WP_DEBUG_LOG', true);
Once this is in place you run your program it will produce an error that shows up in wp-content/debug.log. My error showed:
[10-Apr-2018 16:53:30 UTC] PHP Notice: PHP's XML extension is not available. Please contact your hosting provider to enable PHP's XML extension. in /home/cqinfo/www-wordpress/wp-includes/IXR/class-IXR-message.php on line 48
From here it was rather simple to solve. I had my admin install the PHP XML extension. AND RESTART apache.
Hope this helps others solve the mystery of the -32700 error for others.
We use this to populate a weekly news clipping that has our own thoughts on what is going on in the world of AI and Machine learning at CloudQuant.
Try this
from wordpress_xmlrpc import Client, WordPressPost
from wordpress_xmlrpc.methods import posts
host = 'http://sample.com'
wp = Client(host+'/xmlrpc.php', 'root', 'password')
r = wp.call(posts.GetPosts())
It looks like PHP XML extension is not installed on the server.
Ubuntu:
sudo apt-get install php-xml
sudo service apache2 restart
This resolved the issue in my case.
Related
I am in big trouble. I installed a nulled version of woocommerce cart based shipping plugin and i found it not relevant according to my requiremnet and deleted that plugin from plugins area. After deleting that plugin my site went down. Its continuously showing me Fatal error:
Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /home/dev/public_html/new/wp-includes/wp-db.php:1570
Stack trace:
#0 /home/dev/public_html/new/wp-includes/wp-db.php(658): wpdb->db_connect()
#1 /home/dev/public_html/new/wp-includes/load.php(404): wpdb->__construct('dev_test', 'password', 'dev_test_ne...', 'localhost')
#2 /home/dev/public_html/new/wp-settings.php(107): require_wp_db()
#3 /home/dev/public_html/new/wp-config.php(82): require_once('/home/dev/p...')
#4 /home/dev/public_html/new/wp-load.php(37): require_once('/home/dev/p...')
#5 /home/dev/public_html/new/wp-blog-header.php(13): require_once('/home/dev/p...')
#6 /home/dev/public_html/new/index.php(17): require('/home/dev/p...')
#7 {main} thrown in /home/dev/public_html/new/wp-includes/wp-db.php on line 1570
I tried replacing all core files excluding wp-config.php and wp-content folder. Still I am getting the same error.
Also, i tried renameing plugins folder but the error is there.
Can you guys suggest me how i can get my site back.
I encountered this problem upgrading from PHP 5 to PHP 7 (on Windows). The problem was mysqli PHP extension was not enabled. If mysqli is not available Wordpress 5+ detects this and will instead attempt to connect to the database with deprecated mysql_connect() calls. This leads to a very misleading error message about mysql_connect() function not being available (since we don't want this function).
In php.ini make sure extension_dir is set (use full directory name) and mysqli extension is enabled
extension_dir = "C:\php-7.3.10\ext"
...
extension=mysqli
To double check what extensions are active you can run the following code
<pre>
<?php print_r(get_loaded_extensions()); ?>
</pre>
Possible error sources:
Since PHP 7, mysql_* functions have been removed, see PHP's official overview of the MySQL drivers.
You use PHP 5.x and have not enabled the mysql extension, but mysqli and/or pdo_mysql instead.
You can set
define('WP_USE_EXT_MYSQL', true);
in your wp-config.php file to make WordPress use the mysqli extension.
It happens for me when I switch from 5.6 php to 7.0.
Just enable "mysqli" in your select php version if you use cPanel.
Just registered to give a big thank you for the solution of enabling mysqli. I have been struggling to get WordPress running on a Synology for the past 3.5 hours and this finally fixed my dreaded "The site is experiencing technical difficulties."
For any other Synology users ending up in this topic after trying to find a solution, to fix this on Synology, you need to...
Go to Web Station
Select PHP Settings
Double-click the PHP profile you are using (or click once and choose [Edit])
Select General Settings and scroll to the extensions list
Find mysqli and enable by placing a checkmark
Push the [OK] button (no restart required)
Please check your wp-config.php file for the following line:
define('WP_USE_EXT_MYSQL', true);
If you find it, delete the line. Your problem should be fixed.
If not, you can tick nd_mysqli extension in the PHP 7 configuration, and disable the mysqli extension on Cpanel -> Select PHP version.
Source:
https://wordpress.org/support/topic/database-cache-causing-503-errors-when-upgrading-to-php-7/
Hope this helps. :)
The error seems be simple, mysql_* functions are not enabled.
Check with phpinfo() if these functions are truly disabled, and if yes, enable it.
If no, there are some problems in the code that you are using, but if you have replaced all files as you write, is most probably the first option.
Just had a similar problem with a cpanel multiphp instance. Tried just about everything but while cpanel/whm was saying all was fine, the site would crash when 7.x was activated.
In the end, it was the .htaccess file. We renamed and let Cpanel regenerate and all is good.
Hope this helps someone out there as it took some time to resolve here.
i had same kind of issue for my web hosting client at magicworkshost , i have updated php version from 5.6 to 7.3 and issue resolved successfully.
Thanks
sudo apt-get install php7.4-mysql
sudo service apache2 restart
When I try to use the sample code:
$fp = fopen("gs://my_bucket/some_file.txt", "w");
fwrite($fp, "Hello");
fclose($fp);
I get this error:
Warning: fopen(): Unable to find the wrapper "gs" - did you forget to enable it when you configured PHP?
UPDATE
Switching to running the app server from the command line made the original error go away but I now get this error:
'google\appengine\runtime\RPCFailedError' with message 'Remote implementation for urlfetch.Fetch failed'
Does anyone know how I can resolve it?
Where are you seeing this error? On the production server, testing locally using our SDK or are you not using the SDK?
We install this handler as part of our setup script, so you need to be running in the dev appserver if your testing locally.
You have to use dev_appserver.py (from GAE PHP SDK) to check your code locally. Do not run it through your local webserver, since it will not provide additional plugins (for example gs: stream support) and won't emulate "whole" GAE environment (Datastore, Memcache, Tasks etc.).
On Debian following should work:
sudo apt-get install php5-cgi
/path/to/google_appengine/dev_appserver.py --php_executable_path=/usr/bin/php-cgi .
assuming that:
you have downloaded and installed GAE PHP SDK
you're in your GAE test application directory
You will have to enter localhost website on port 8080 to check if you have your app working. On localhost port 8000 you have admin server in which you can check data in your local Datastore.
After that you can place phpinfo() in your .php file to check if you have 'gs' supported in "Registered PHP Streams" row.
Using "file_put_contents" instead of "fopen" fixed the problem for me.
Thanks
As the error suggests, the wrapper i.e. 'gs' is undefined.
Their are some build-in wrappers by php that can be used in fopen php function; for the custom wrappers i.e. 'gs' in your case, stream_wrapper_register php function can be used.
Reference links:
http://www.php.net/manual/en/wrappers.php
http://www.php.net/manual/en/function.stream-wrapper-register.php
I am currently moving my web app to amazon ec2. Since it's only for testing, I use the free version called ec2 free tier with windows server 2008 instance. However, Although I have done all I know and read this thread ( How to enable cURL in PHP / XAMPP ). I just couldn't use curl on my php script. it always creates the error
Call to undefined function curl_init() in C:\xampp\htdocs\index.php on line 2
Here are all thing I have tried
Install Wamp ( I tried it on XAMPP to)
Uncomment out php_curl in php.ini file ( and restart apache)
Copy two dll files to both system32 and syswow64
Could it have to do with the fact that I am using free vps?
Update:
Also, when I started the apache server in XAMPP , this error appeared
'PHP Startup: unable to load dynamic library curl.dll'
However, I have double checked the ext directory and the php_curl.dll was in there.
i think curl need to access remote sever from our web server. so i opened all traffic in my server outbound rule and it works. i think this is not good solution. still look for better way.
nope.
be sure, that you have the files in the right place, usually its in the plugins folder for php! maybe you cann add a absolute path to your php.ini!
be sure, you edit the correct ini file!
php completly independent to your operatingsystem!
just be sure to doublecheck everything. because its not saying, it has trouble loading your extention, its just saying, the function your trying to call, is not there. so i assume your extention ist not loading at all! :)
One reason I did notice for this cURL plugin to malfunction was the availability of copies of libeay32.dll and ssleay32.dll files. Please check whether your system32 folder has such copies and if so, please rename them to some other names and copy the ones found with the php installation. Sometimes you may need to restart your machine. This was documented here some time ago.
I had a similar problem, but it occours just with requests under https. I tried to create a curl request directly from the ec2 machine and got a error: "curl: (77) error setting certificate verify locations".
It looks like some kind of ssl validation fail because of a certificate not found. So I used a parameter -k (or --insicure) in my curl command, to ignore this validation and after that my curls request did directly from ec2 machine worked.
So I tried to apply a similar ideia in my curl command in php, (I suppoused that the curl php extension forward this requests to the operation system) and I found this curl opt:
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
After that it works to me.
Probably this isn't the best way to solve the problem, but solved my problem temporarelly.
UPDATE (5/21/2010) SUCCESS!
So after MUCH $head->desk()'ing, I've solved it.
Remember kids, be wary of the instant client version you use, dependent on the virtualization settings!
I had been installing the generic Instant Client (not aware our ESX servers sit on AMD processors, not Intel) and that worked fine internally (the CentOS install was 32-bit since our internal ESXi servers aren't 64-bit). Well lo-and-behold, even if you have a 32-bit install running on a virtualized server which is sitting on an AMD64, it still matters what instant client you install.
It was the last thing I thought to check but as it appears, everything is running fine now.
I would like to thank everyone who helped me run through every possible test to figure this out but in the end, it was my fault for not realizing the differences in the virtualizations.
UPDATE (5/21/2010)
I thought this bug had escaped me when I installed it on a new VM internally but I have now found a narrowing link.
I was trying to install this on our production server when I posted this. After a week of no progress and in need to get back to development, I outfitted a VM on our internal server with a brand new install of Crap... CentOS, and fresh installs of instant client and oci8.
Worked perfectly.
However we just uploaded an exact copy of the VM to our production servers and it magically no longer works. Tried reinstalling everything, no avail.
So the only things I could narrow it down to is a firewall issue (although I get the same issue when trying 127.0.0.1) or possibly an ESX (our production servers) server issue, internal servers are running ESXi.
Any thoughts?
UPDATE (3/8/2010) I installed Xdebug and have it tracing my code. This is the output I am getting:
TRACE START [2010-03-08 17:53:05]
0.2090 327864 -> {main}() /data/aims3/http/octest.php:0
0.2091 327988 -> ini_set(string(14), string(1)) /data/aims3/http/octest.php:3
0.2093 327920 -> error_reporting(long) /data/aims3/http/octest.php:4
0.2094 328048 -> oci_connect(string(8), string(8), string(25)) /data/aims3/http/octest.php:6
The trace halts at that point.
I have installed everything the same way on a local server and it works fine. To say I am at a complete loss would be putting it lightly.
*NOTE: I ran make test and it returned FAIL on every test. I never ran this on my working machine to see if it reports the same errors. Any idea why make test would report FAIL but make doesn't report any error?
I've installed the Oracle Instantclient with no reported errors along with the OCI8 PECL package and at a loss. Whenever I try to open a connection with oci_connect, it halts my entire PHP script.
EXAMPLE:
<?php
ini_set ("display_errors", "1");
error_reporting(E_ALL);
echo "before";
$conn = oci_connect("username", "password", "host");
echo "after";
?>
Returns a complete blank page. The module is loaded (seen in phpinfo) and everything installed with no errors.
I am at a complete loss.
CentOS: 5.4
Apache: 2.2.3
PHP: 5.3.1
InstantClient: 11.2
oci8: 1.4.1
Any thoughts?
NOTES
Apache Error Log reports nothing
Attempted Debugging:
1:
<?php
ini_set ("display_errors", "1");
error_reporting(E_ALL);
echo "before";
if(!function_exists('oci_connect')) die('Oracle Not Installed');
echo "after";
?>
Returns:
beforeafter
2:
Changing host to //host
Returns:
Same error
Is there anything in Apache's error_log? Is this mod_php or FastCGI or normal CGI PHP? What happens if you run the script via the command line?
You could also try setting PHP's error log and looking in there.
EDIT1: Try:
echo "before";
if(!function_exists('oci_connect')) die('Oracle Not Installed');
And post the results...
EDIT2: I'm really not sure. My best bet is this info from the PHP manual:
The most common problem with
installing OCI8 is not having the
Oracle environment correctly set. This
typically appears as a problem using
oci_connect() or oci_pconnect(). The
error may be a PHP error such as Call
to undefined function oci_connect(),
an Oracle error such as ORA-12705, or
even an Apache crash. Check the Apache
log files for startup errors and see
the sections above to resolve this
problem.
Anyone else have any ideas to help out Bryan?
Bryan,
I am going to be honest: I tried this two years ago and failed miserably. :) I could not get the OCI functions to work for anything by compiling myself.
But in the interest of getting it done I looked for an alternate solution and found it in Zend Core for Oracle. All I did was download, run the installer, and it was done. It installs Apache/PHP, MySQL (optional), and the InstantClient for you.
Now as Zend Server, it is basically the same product. I realize that this may not be the solution you hoped for, but if it works...
Zend Server
are you connecting to remote or to local db? i think, for localhost you must replace "host" with "false". I hope, this will help you...
edit: i think, you are missing a parameter...my last suggestions are: 1. you must set the port (default 1521) AND/OR 2. You must enter db name AND/OR you must set the instance name (the ORACLE_SID parameter)
You never check the return value of oci_connect() or call oci_error() but it doesn't look relevant to your problem since you seem to be suffering from a PHP crash. There's an open bug for RHEL that may affect you too:
http://pecl.php.net/bugs/bug.php?id=16626
Did you build the oci8 package yourself? Are you using a third-party binary?
It has been fixed. See the top for details but here is the cliff notes: virtualiztion environments matter.
I downloaded the Aptana_Studio_Setup_Linux.zip package, unpacked it and run ./AptanaStudio. It starts fine, but reports one problem:
The embedded browser widget for this editor cannot be created. It is either not available for your operating system or the system needs to be configured in order to support embedded browser.
After that, it opens the "Welcome page" in external browser (Mozilla), but when I click on a link to install PHP support it does not open the destination target. No wonder, because the link is in format: com.aptana....etc. I.e. written in reverse. I assume such links only work with internal browser.
If I look into details, I get these error messages:
No more handles [Unknown Mozilla path (MOZILLA_FIVE_HOME not set)]
org.eclipse.swt.SWTError: No more handles [Unknown Mozilla path (MOZILLA_FIVE_HOME not set)]
at org.eclipse.swt.SWT.error(SWT.java:3400)
at org.eclipse.swt.browser.Browser.<init>(Browser.java:138)
at org.eclipse.ui.internal.browser.BrowserViewer.<init>(BrowserViewer.java:224)
at org.eclipse.ui.internal.browser.WebBrowserEditor.createPartControl(WebBrowserEditor.java:78)
at com.aptana.ide.intro.browser.CoreBrowserEditor.createPartControl(CoreBrowserEditor.java:138)
at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:596)
at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:372)
at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:566)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:290)
etc. I hope this is enough.
I tried to set the env. variable:
export MOZILLA_FIVE_HOME=/usr/lib/mozilla/
However, it only changes the error message to:
No more handles [NS_InitEmbedding /usr/lib/mozilla/ error -2147221164]
org.eclipse.swt.SWTError: No more handles [NS_InitEmbedding /usr/lib/mozilla/ error -2147221164]
at org.eclipse.swt.SWT.error(SWT.java:3400)
at org.eclipse.swt.browser.Browser.<init>(Browser.java:225)
at org.eclipse.ui.internal.browser.BrowserViewer.<init>(BrowserViewer.java:224)
at org.eclipse.ui.internal.browser.WebBrowserEditor.createPartControl(WebBrowserEditor.java:78)
at com.aptana.ide.intro.browser.CoreBrowserEditor.createPartControl(CoreBrowserEditor.java:138)
at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:596)
at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:372)
For start I really want to have PHP working, but I'd also like to fix the whole internal browser issue in the end.
I happened to come across this: https://groups.google.com/forum/#!msg/xmind/5SjPTy0MmEo/PbPi0OGzqPwJ
Which advised running:
sudo apt-get install libwebkitgtk-1.0-0
should solve the problem. It worked for me so I figured I'd share here.
FWIW, I ended up here while trying to get the Play! Framework working on Ubuntu 13.04. using the Scala-IDE. So far, everything seems to be working...
You need to download and install XULRunner from mozilla.org, and point MOZILLA_FIVE_HOME to that directory.
After installing xulrunner you need to set this:
MOZILLA_FIVE_HOME=/usr/lib/xulrunner
You will have to install XULRunner then edit the eclipse.ini.
After installing xulrunner, adding the following line in the eclipse.ini solved the problem of "No more handles" issue.
-Dorg.eclipse.swt.browser.XULRunnerPath=/opt/eclipse/xulrunner/
I am using eclipse 3.63 and ubuntu 12.04.
Edit: getting internal browser to work is NOT required in order to get PHP support in Aptana. Just install PHP support from Help, Software updates menu.
If this is the problem I think you're having, just installing Firefox 2 (alongside FF3) should fix the issue. It happens because Aptana can only use FF2 at the moment. Hopefully they'll fix this soon.
If you're on Ubuntu, it's really just a case of:
sudo apt-get install firefox-2
Naturally, the process will vary on different distributions.