Lucky13
Lucky13

Reputation: 11483

how to enable .zip extension in server

I want to enable the .zip extension in my server. I added the below code in a php.ini file. But the website will take the default php.ini file.

extension=php_zip.dll
extension=zip.so

If I upload it in to the root directory of my website. Is there any way to take the uploaded php.ini instead of default php.ini ??

Or is there any other way (.htaccess) to enable .zip extension in the server??

Upvotes: 1

Views: 16462

Answers (2)

Shahryar Moradi
Shahryar Moradi

Reputation: 1

I added the following line in the file: C:\xampp\php\ext\PHP.ini (can be opened from XAMPP Control Panel => Apache => config)

extension=php_zip.dll

And then stop and start, XAMPP Apache service worked

Upvotes: 0

hakre
hakre

Reputation: 198119

If I upload it [the php.ini file] in to the root directory of my website. Is there any way to take the uploaded php.ini instead of default php.ini?

You need to contact your hoster which options it offers. By default just uploading a (php.ini) file will place that file in your webroot so it can be downloaded by visitors but it has not influence on your PHP configuration.

Or is there any other way (.htaccess) to enable .zip extension in the server?

No, per .htaccess there is no way to enable the .zip extension. The extension PHP ini-directive is for php.ini only.

You need to contact your hoster and discuss the issue, many hosters offer to install extensions for you and also they offer some mechanism to allow you to specify your own php.ini but how that is done depends on the hoster.

Upvotes: 3

Related Questions