WHM API: Updating PHP version/Adding database on single account
I'm currently using WHM API and have successfully been able to use the createacct function to launch a new site on WHM. The only thing is, the default PHP version on our WHM account is PHP5.6 and I need these sites to be PHP7.2. I'd also like to be able to update the php.ini file per setup. And of course, set up an SMTP account with the API.
Added bonus would be help on how I can create a database using the API, and import my sql template. Also, cloning my project skeleton into file manager on the newly created accounts.
Please help!
-
The only thing is, the default PHP version on our WHM account is PHP5.6 and I need these sites to be PHP7.2
You can use the multiPHP manager to modify your PHP version for each account on the server - to set the default php version for accounts as well. You can use whmapi1 to do this too the function for this can be found here: WHM API 1 Functions - php_set_system_default_version - Developer Documentation - cPanel DocumentationI'd also like to be able to update the php.ini file per setup
Can you explain in more detail what you mean for this and I can probably get you pointed in the right direction.set up an SMTP account with the API.
That can be done using UAPI - Create the User:and import my sql template
I'm not entirely sure what you mean here as far as the template goes, can you elaborate?Also, cloning my project skeleton into file manager on the newly created accounts.
I think this might for work for what you're looking for0 -
For php.ini, I would like to set: upload size to 100M, memory_limit to 100M, max_execution_time to 90. For importing my sql template, this is a copy of the database tables with some prefilled content. It is a .sql I just need to import into the newly created database. Thank you!!! 0 -
Oh, and is there a way to add IMAP vs POP? I do not see that in the UAPI url you sent :/ 0 -
For php.ini, I would like to set: upload size to 100M, memory_limit to 100M, max_execution_time to 90.
You could set these globally for each PHP version WHM API 1 Functions - php_ini_set_content - Developer Documentation - cPanel Documentation WHM API 1 Functions - php_ini_set_directives - Developer Documentation - cPanel DocumentationFor importing my sql template, this is a copy of the database tables with some prefilled content. It is a .sql I just need to import into the newly created database.
All the MySQL related UAPI functions can be found here: UAPI Modules - Mysql - Developer Documentation - cPanel Documentation Though I don't think what you're looking for exactly is here, it almost sounds like importing a mysqldump is more along what you're looking to do.Oh, and is there a way to add IMAP vs POP? I do not see that in the UAPI url you sent :/
While the UAPI function's name is deceiving any email account created within cPanel can be used as POP or IMAP when connecting to a mail client, when using webmail it's an IMAP connection0 -
For php.ini, is there a way to set these individually for each account? There are many other accounts that don't need these updates, and could bog our server. 0 -
There sure is, you can use the UAPI to do this: UAPI Functions - LangPHP::php_ini_set_user_basic_directives - Developer Documentation - cPanel Documentation 0
Please sign in to leave a comment.
Comments
6 comments