PHP login to account for FTP & DB access
Hi there,
I'm new to the WHM/CPanel API but I need it to create accounts automaticly with PHP (which I got to work) and then upload files to it and create a DB automaticly too. However I didn't find any functionality for that part.
However I assume it is possible to automaticly upload files to a specific CPanel account using PHP?
If anyone could help me out / point me in the correct direction, thanks in advance!
Best regards,
Skyfe.
EDIT: Figured out how to create a database Matt's API, but not yet how to upload files, if anyone knows how to..?
-
[quote="skyfe, post: 1461871">Hi there, I'm new to the WHM/CPanel API but I need it to create accounts automaticly with PHP (which I got to work) and then upload files to it and create a DB automaticly too. However I didn't find any functionality for that part. However I assume it is possible to automaticly upload files to a specific CPanel account using PHP? If anyone could help me out / point me in the correct direction, thanks in advance! Best regards, Skyfe. EDIT: Figured out how to create a database Matt's API, but not yet how to upload files, if anyone knows how to..?
If the files are the same for each account, you can use the skeleton directory for this: [url=http://docs.cpanel.net/twiki/bin/view/AllDocumentation/WHMDocs/SkeletonDirectory]Skeleton Directory If not, you can use the Fileman::savefile() API2 call to create a file from a string: [url=http://docs.cpanel.net/twiki/bin/view/ApiDocs/Api2/ApiFileman#Fileman::savefile]Fileman Module Documentation You can also use the account's username and password to connect via FTP using the built-in PHP FTP functions: [url=http://php.net/manual/en/book.ftp.php]PHP: FTP - Manual0
Please sign in to leave a comment.
Comments
2 comments