Jump to content
Sign in to follow this  
EIE

How to enable RPC XML extension on PHP?

Recommended Posts

Dear All,

 

We are desperate for a solution and our project is stuck since 2 weeks, cannot launch !

 

We have a root server. We need to create an automatic FTP username password for users who register on our website. We have been able to generate this via XML RPC and but cannot install it in PHP as our code is written in PHP. It's become highly frustrating and any assistance in this would be highly appreciated.

 

Can someone get us through this small issue?

 

Thanks everyone for looking into this.

 

Regards

Mani

Share this post


Link to post
Share on other sites

Normally this sort of thing is handled by putting authentication in a database; the FTP server software looks in there for the username and password, as well as home directory and whatnot, rather than in a file or expecting system-level users.

 

Your post is a bit lacking in details. What can't you do? Generate what with XML RPC? You can't install something in PHP because the code is written in PHP?

Share this post


Link to post
Share on other sites

Thanks for your reply. 

 

XML RPC extension is enabled on the server. In PHP code, its not generating a response. 

 

Can you help please? 

 

Here's the response code

 

<?php
 
require_once('PleskApiClient.php');
 
$host = getenv('REMOTE_HOST');
$login = getenv('REMOTE_LOGIN') ?: 'admin';
$password = getenv('REMOTE_PASSWORD');
 
$client = new PleskApiClient($host);
$client->setCredentials($login, $password);
 
$request = <<<EOF
<packet>
<ftp-user>
<add>
   <name>abhisheknew</name>
   <password>jdnHHbe6Gc</password>
   <home/>
   <webspace-id>1</webspace-id>
</add>
</ftp-user>
</packet>
EOF;
 
$response = $client->request($request);
print_r($response);
echo "Response: ".$response;

Share this post


Link to post
Share on other sites

Are there any errors or warnings? Is the request being received? What is the value of $response?

Share this post


Link to post
Share on other sites

No error or response, blank. When we are doing echo $response, no output..

 

Everything is working in XML, only bringing in PHP is the issue. Can we solve this?

 

XML request ok

 

<ftp-user>
<add>
   <name>abhisheknew</name>
   <password>jdnHHbe6Gc</password>
   <home/>
   <webspace-id>1</webspace-id>
</add>
</ftp-user>
 
 
This generated a user in ftp, but in PHP we cannot generate somehow..
 
IS there a way to connect with you sir?

Share this post


Link to post
Share on other sites

"echo $response" might not show anything. What does

var_dump($response);
show? If you say there's no output then there is some other problem and you probably don't have PHP set up to show errors properly.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.