You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在cPanel中无需EasyApache或SSH启用mbstring扩展(PHP 7适用)

Hey there, let's tackle your two questions about enabling the mbstring extension in cPanel without EasyApache, especially for PHP 7 when you don't have SSH access.

不借助EasyApache工具在cPanel中启用mbstring扩展

Most modern cPanel setups come with built-in tools to manage PHP extensions without relying on EasyApache. Here's what you can do:

  • Log into your cPanel dashboard, navigate to the Software section, and look for Select PHP Version (this might be labeled differently on some hosts, but it's the standard tool for per-site PHP config).
  • If you're in the "Native PHP" mode, switch to the PHP Options tab (some interfaces show a direct list of extensions right away).
  • Scroll through the extension list until you find mbstring, check the box next to it, then hit the Save button at the bottom of the page.
  • To confirm it's enabled, create a phpinfo.php file in your site's root directory (like public_html) with the content <?php phpinfo(); ?>, then access it via your browser. Search for "mbstring" in the output—you should see its details if it's active.
PHP 7版本无SSH权限时的替代方案

If the above method doesn't work (maybe your host restricts the PHP selector), using a .user.ini file is a reliable alternative for PHP 7 on cPanel (especially with PHP-FPM setups):

  • Open cPanel's File Manager, navigate to your site's root directory (usually public_html).
  • If there's no .user.ini file present, create a new one (make sure the filename starts with a dot). If it exists, edit the existing file.
  • Add this line to the file: extension=mbstring.so (for PHP 7, this is the correct extension name for most cPanel environments; if that doesn't work, try just extension=mbstring).
  • Save the file. Keep in mind that PHP-FPM might take a few minutes to pick up the new config—if you need it to take effect immediately, you can reach out to your host's support team to clear the PHP cache.
  • Again, verify with a phpinfo.php file to confirm mbstring is enabled.

A quick note: If neither of these methods work, it's likely your hosting provider has locked down PHP extension permissions. In that case, your best bet is to submit a support ticket asking them to enable mbstring for your account—most hosts will do this for free since mbstring is a common, essential extension.

内容的提问来源于stack exchange,提问作者Sathish Kumar

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.21 06:25:32