You can use web3.eth.accounts in web3js
web3.eth.accounts.create();
With Php, you can try something like this:
newAccount = '';
$web3->personal->newAccount('123456', function ($err, $account) use(&$newAccount) {
if ($err !== null) {
echo 'Error: ' . $err->getMessage();
return;
}
$newAccount = $account;
echo 'New account: ' . $account . PHP_EOL;
});
To know more, visit: https://web3js.readthedocs.io/en/1.0/web3-eth-accounts.html#create