如何使用.htaccess文件启用php扩展名

问题描述:

我只需要在我的网站的子域中启用php_intl扩展名,所以我使用.htaccess文件来执行此代码.

I need to enable php_intl extension only in a subdomain of my website, so i use the .htaccess file to do it with this code.

<IfModule mod_php4.c>
    php_extension_dir php_intl.dll
    php_extension php_intl.dll
</IfModule>

但是不行. 有人帮我吗?

But not work. Someone helpe me, please?

指令php_extension_dir应为:

php_extension_dir <path_to__php_extensions>

<path_to_php_extensions>是安装PHP扩展的绝对路径.只需将文件名放在这里就无济于事,因为需要路径值.

Where <path_to_php_extensions> is the absolute path to where your PHP extensions are installed. Simply putting the file name here does nothing, since a path value is expected.

如果这仍然不起作用,则将PHP设置为CGI,因此无法使用htaccess加载模块. 在这种情况下.

If this still does not work, then PHP is set up as CGI and therefore cannot use htaccess to load modules. Take a look here if that is the case.