Solved

Disable MagickWand PHP Extension

Posted on 2010-09-10
7
528 Views
Last Modified: 2013-12-13
The PHP extension MagickWand is installed on my system.  How can I disable it for PHP scripts located in a specific directory?
0
Comment
Question by:hankknight
  • 5
7 Comments
 
LVL 40

Expert Comment

by:Richard Quadling
ID: 33652604
Hmm...

Really, hmmmmmmmmm, ....

I initially thought that a combination of disable_class and disable_functions would cover it, but these are php.ini only and not httpd.conf

At this stage, I'm not finding an obvious answer.

Back in a bit with more ideas.
0
 
LVL 40

Expert Comment

by:Richard Quadling
ID: 33652610
I suppose depending upon your directory structure you could turn it around and only enable the extension if in that directory.

0
 
LVL 20

Assisted Solution

by:virmaior
virmaior earned 50 total points
ID: 33653591
I am not seeing it well-documented but you could try adding

a php_value value to disable it...

I am not sure what that line would be per se as I don't know what it adds other than the extension line to the php.ini file.

http://drupal.org/node/87138
0
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 
LVL 40

Expert Comment

by:Richard Quadling
ID: 33654280
Just not loading it first would be the simplest. This is a LOT harder if you have compiled it statically.

I'm waiting on a response from some of the core dev's, but I'm thinking that you can't disable it from 1 directory, only enable it.
0
 
LVL 40

Expert Comment

by:Richard Quadling
ID: 33656009
This is the reply I got and I should have though of it myself. Ho hum. Distractions due to ... well ... Facebook tells you all ...

"As I thought, looking through the docs, it looks like the only way to set the options that are only settable via the php.ini file is to use a per directory php.ini file.  But, the problem with that is, it only works with the CGI/FASTCGI SAPI version of php.  It won't work with the apache mod version.

So, I guess the question back to you is, what is your setup like?  And if it isn't CGI/FASTCGI SAPI are you willing to change to that setup?

Read More: http://www.php.net/manual/en/configuration.file.per-user.php"

0
 
LVL 40

Accepted Solution

by:
Richard Quadling earned 450 total points
ID: 33660701
Some additional questions.

1 - What OS, web server and PHP Version and SAPI are you using?

Windows/unix/linux/etc., IIS/Apache/etc. 4.what.what/5.what.what, cgi-fastcgi/isapi/mod/etc.

2 - Why do you want to disable this one extension?

Is this just to see if there is a way or are you having specific problems with it, e.g. name clashing between your own code and the classes from the extension.



Depending upon the reason in Q2, maybe the use of namespaces would help you ... http://docs.php.net/manual/en/language.namespaces.php

0
 
LVL 16

Author Comment

by:hankknight
ID: 33671186
Thank you for thoughtful responses.  As luck would have it, my system uses the Apache mod version of PHP.

I am trying to test a PHP-powered image manipulation application for computability issues.  I will temporarily change my global php.ini file while I run the tests.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question