admin管理员组文章数量:1126451
Just downloaded wordpress latest, using LAMP (Apache2/MariaDB and PHP8.2) and curling it returns this
curl http://localhost:80/wordpress/xmlrpc.php; echo
XML-RPC server accepts POST requests only.
curl -X POST http://localhost:80/wordpress/xmlrpc.php; echo
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
<fault>
<value>
<struct>
<member>
<name>faultCode</name>
<value><int>-32700</int></value>
</member>
<member>
<name>faultString</name>
<value><string>parse error. not well formed</string></value>
</member>
</struct>
</value>
</fault>
</methodResponse>
It seems running. When I use python client
>>> from wordpress_xmlrpc import Client
>>> c = Client('http://127.0.0.1/wordpress/xmlrpc.php', 'wordpressuser', 'wordpressuser69$')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.11/dist-packages/wordpress_xmlrpc/base.py", line 24, in __init__
self.supported_methods = self.server.mt.supportedMethods()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/xmlrpc/client.py", line 1122, in __call__
return self.__send(self.__name, args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/xmlrpc/client.py", line 1464, in __request
response = self.__transport.request(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/xmlrpc/client.py", line 1166, in request
return self.single_request(host, handler, request_body, verbose)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/xmlrpc/client.py", line 1182, in single_request
return self.parse_response(resp)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/xmlrpc/client.py", line 1354, in parse_response
return u.close()
^^^^^^^^^
File "/usr/lib/python3.11/xmlrpc/client.py", line 668, in close
raise Fault(**self._stack[0])
xmlrpc.client.Fault: <Fault -32700: 'parse error. not well formed'>
>>>
The user and password is valid and I am testing in localhost for now but error isnt expected here I think. Do you know what could be the problem? I am using someone else library and it fails at xmlrpc. The library has bugs which I fixed but now its in this xmlrpc error . ChatGPT gave me sample code to check if its working or not
from wordpress_xmlrpc import Client
wp = Client('http://localhost:80/wordpress/xmlrpc.php', 'wordpressuser', 'wordpressuser69$')
print(wp.call('system.listMethods'))
but even the client part is giving me errors. Both Client('http://localhost:80/wordpress/xmlrpc.php', 'wordpressuser', 'wordpressuser69$')
and Client('http://127.0.0.1:80/wordpress/xmlrpc.php', 'wordpressuser', 'wordpressuser69$')
gives me error.
This seemingly valid request also produces error:
curl -X POST http://localhost:80/wordpress/xmlrpc.php -d '<?xml version="1.0"?><methodCall><methodName>system.listMethods</methodName></methodCall>'
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
<fault>
<value>
<struct>
<member>
<name>faultCode</name>
<value><int>-32700</int></value>
</member>
<member>
<name>faultString</name>
<value><string>parse error. not well formed</string></value>
</member>
</struct>
</value>
</fault>
</methodResponse>
I also do not see any xmlrpc checkboxes in http://localhost/wordpress/wp-admin/options-writing.php
. Afaik, xmlrpc is enabled by default. But still I tried putting this line in define('XMLRPC_REQUEST', true);
in wp-config.php file and it breaks, admin page is undisplayable but if i remove this line admin page is displayable.
Could it be related to bad apache2 configuration in /etc/apache2/sites-available/wordpress.conf
. This is the content
<VirtualHost *:80>
ServerAdmin webmaster@your_domain
DocumentRoot /var/www/html/wordpress
ServerName your_domain
ServerAlias www.your_domain
<Directory /var/www/html/wordpress/>
AllowOverride All
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
and this is the command issued after writing this. I havent changed anything in conf since I am testing in localhost not VPS where I plan to deploy the website after buying a domain
sudo a2ensite wordpress.conf
sudo systemctl restart apache2
Just downloaded wordpress latest, using LAMP (Apache2/MariaDB and PHP8.2) and curling it returns this
curl http://localhost:80/wordpress/xmlrpc.php; echo
XML-RPC server accepts POST requests only.
curl -X POST http://localhost:80/wordpress/xmlrpc.php; echo
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
<fault>
<value>
<struct>
<member>
<name>faultCode</name>
<value><int>-32700</int></value>
</member>
<member>
<name>faultString</name>
<value><string>parse error. not well formed</string></value>
</member>
</struct>
</value>
</fault>
</methodResponse>
It seems running. When I use python client
>>> from wordpress_xmlrpc import Client
>>> c = Client('http://127.0.0.1/wordpress/xmlrpc.php', 'wordpressuser', 'wordpressuser69$')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.11/dist-packages/wordpress_xmlrpc/base.py", line 24, in __init__
self.supported_methods = self.server.mt.supportedMethods()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/xmlrpc/client.py", line 1122, in __call__
return self.__send(self.__name, args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/xmlrpc/client.py", line 1464, in __request
response = self.__transport.request(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/xmlrpc/client.py", line 1166, in request
return self.single_request(host, handler, request_body, verbose)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/xmlrpc/client.py", line 1182, in single_request
return self.parse_response(resp)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/xmlrpc/client.py", line 1354, in parse_response
return u.close()
^^^^^^^^^
File "/usr/lib/python3.11/xmlrpc/client.py", line 668, in close
raise Fault(**self._stack[0])
xmlrpc.client.Fault: <Fault -32700: 'parse error. not well formed'>
>>>
The user and password is valid and I am testing in localhost for now but error isnt expected here I think. Do you know what could be the problem? I am using someone else library and it fails at xmlrpc. The library has bugs which I fixed but now its in this xmlrpc error https://github.com/seedgularity/AIBlogPilotGPT. ChatGPT gave me sample code to check if its working or not
from wordpress_xmlrpc import Client
wp = Client('http://localhost:80/wordpress/xmlrpc.php', 'wordpressuser', 'wordpressuser69$')
print(wp.call('system.listMethods'))
but even the client part is giving me errors. Both Client('http://localhost:80/wordpress/xmlrpc.php', 'wordpressuser', 'wordpressuser69$')
and Client('http://127.0.0.1:80/wordpress/xmlrpc.php', 'wordpressuser', 'wordpressuser69$')
gives me error.
This seemingly valid request also produces error:
curl -X POST http://localhost:80/wordpress/xmlrpc.php -d '<?xml version="1.0"?><methodCall><methodName>system.listMethods</methodName></methodCall>'
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
<fault>
<value>
<struct>
<member>
<name>faultCode</name>
<value><int>-32700</int></value>
</member>
<member>
<name>faultString</name>
<value><string>parse error. not well formed</string></value>
</member>
</struct>
</value>
</fault>
</methodResponse>
I also do not see any xmlrpc checkboxes in http://localhost/wordpress/wp-admin/options-writing.php
. Afaik, xmlrpc is enabled by default. But still I tried putting this line in define('XMLRPC_REQUEST', true);
in wp-config.php file and it breaks, admin page is undisplayable but if i remove this line admin page is displayable.
Could it be related to bad apache2 configuration in /etc/apache2/sites-available/wordpress.conf
. This is the content
<VirtualHost *:80>
ServerAdmin webmaster@your_domain.com
DocumentRoot /var/www/html/wordpress
ServerName your_domain.com
ServerAlias www.your_domain.com
<Directory /var/www/html/wordpress/>
AllowOverride All
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
and this is the command issued after writing this. I havent changed anything in conf since I am testing in localhost not VPS where I plan to deploy the website after buying a domain
sudo a2ensite wordpress.conf
sudo systemctl restart apache2
Share
Improve this question
edited Jan 15, 2024 at 20:05
fuxia♦
107k38 gold badges255 silver badges459 bronze badges
asked Jan 15, 2024 at 18:04
MachinexaMachinexa
1214 bronze badges
6
|
Show 1 more comment
1 Answer
Reset to default 1Enabling PHP logging and reading logs showed the problem, thanks to Tom.
// Enable WP_DEBUG mode
define( 'WP_DEBUG', true );
// Enable Debug logging to the /wp-content/debug.log file
define( 'WP_DEBUG_LOG', true );
// Disable display of errors and warnings
define( 'WP_DEBUG_DISPLAY', true );
[16-Jan-2024 09:34:09 UTC] PHP Notice: PHP's XML extension is not available. Please contact your hosting provider to enable PHP's XML extension. in /var/www/html/wordpress/wp-includes/IXR/c lass-IXR-message.php on line 48
A simple apt install php-xml fixed it
curl -X POST http://localhost:80/wordpress/xmlrpc.php -d '<?xml version="1.0"?><methodCall><methodName>system.listMethods</methodName></methodCall>' | head
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
<?xml version="1.0" encoding="UTF-8"?> 0 --:--:-- --:--:-- --:--:-- 0
<methodResponse>
<params>
<param>
<value>
<array><data>
<value><string>system.multicall</string></value>
<value><string>system.listMethods</string></value>
<value><string>system.getCapabilities</string></value>
<value><string>demo.addTwoNumbers</string></value>
100 4361 100 4272 100 89 173k 3709 --:--:-- --:--:-- --:--:-- 185k
curl: Failed writing body
Python client also doesn't error now
本文标签: pluginsXMLRPC error xmlrpcclientFault ltFault 32700 39parse error not well formed39gt
版权声明:本文标题:plugins - XMLRPC error: xmlrpc.client.Fault: <Fault -32700: 'parse error. not well formed'> 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736689622a1947853.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
post_to_wordpress
inorchestrar/gutenberg.py
and is covered in warnings that it's for testing only. A version that makes aPOST
request to/wp-json/wp/v2/post
with an application password http header might actually be smaller. Eitherway the chance that this is related to anything Apache is very very low, and there's also a chance your host has blocked XMLRPC queries but since the XMLRPC API replied to tell you your message was malformed that too is unlikely – Tom J Nowell ♦ Commented Jan 15, 2024 at 21:44