How do I set the PATH to use ImageMagick under PHP on my Server?

Hi,
I have the ImageMagick binaries installed. They are working in the terminal.
But when I try to use it out of a php script on the webserver, it cant find the DYLD_LIBRARY_PATH.
The manual says:
Set the MAGICK_HOME environment variable to the path where you extracted the ImageMagick files. For example:
export MAGICK_HOME="$HOME/ImageMagick-6.3.7"
If the bin subdirectory of the extracted package is not already in your executable search path, add it to your PATH environment variable. For example:
export PATH="$MAGICK_HOME/bin:$PATH"
Set the DYLD_LIBRARY_PATH environment variable:
export DYLD_LIBRARY_PATH="$MAGICK_HOME/lib"
I can do all this in the Terminal, but how and where do I set it, that it also works with the scripts on the webserver?
Thanks and Regards,
JO

Joachim,
I have not tested any of this but...
If you are just using the default Mac OS X Server install of Apache and the PHP module, then Apache's path is /usr/bin:/bin:/usr/sbin:/sbin (when running under the user:group=www:www). Basically, if the server is running under that user and PHP inherits the basic PATH of that user's shell, then anything linked into those directories should be available to the scripts, i.e. link your ImagMagick bin and lib paths into /usr 's directories. See 'man ln' in Terminal. User www doesn't have a defined shell, though, so I don't know where the PATH comes from.
Alternatively, you might be able to use Apache's env_module (on by default) to manipulate the PATH environment variable in a config file. See Apache's manual on environment variables.
Another means is to utilize 'suexec' in Apache and switch the user:group of CGI execution, etc. to a actual user with a definable .bash_profile (or whatever shell you are using). There are security concerns with this. See Apache's manual on suexec. You may want to also consider compiling PHP as CGI.
BTW: the new version of PHP has some new experimental native ImageMagick libraries built in. I assume it looks for the binaries in the usual places and/or may need to be compiled with their paths during ./configure.
Larry

Similar Messages

  • How can I set the PATH properly in XP?

    Ive stuffed around for hours trying to do this. Ive installed j2eesdk-1_4_2004Q4-beta-windows.
    I wrote a simple app in jGrasp, then hit compile and it comes up with
    "package javax.ejb does not exist
    import javax.ejb.*;"
    Now my PATH looks something like this
    C:\Sun\AppServer\bin;C:\Sun\AppServer\jdk\bin;C:\Sun\AppServer\lib\j2ee.jar;
    this just doesnt work....
    Can someone who writes j2ee apps in XP plz let me know how to set up the class path so i dont get these package not found errors.
    It would be a great favour, thank you.
    PS when i move the j2ee.jar file into the jre\lib\ext folder it compiles, but this seems dodgy to me. Plz help me.

    Either set the classpath pointing to j2ee.jar when building your app (javac -classpath ...\j2ee.jar) - if you are using ant scripts to build, checkout the samples or blueprints applications for examples of how to set the classpath within ant scripts
    Or set your CLASSPATH environment to ...\j2ee.jar (My Computer->Control Panel->System->Advanced->Environment Variables
    Hope this helps

  • How do I set the preference to use Wired interface instead of Wifi for network?

    I have a MacBook Pro, with Thunderbolt.  Am using the Time Capsule for my wifi and backups.  Is there a way to have both Wired and Wifi connected, but use Wired when available for faster downloads as well as faster backups?
    WIll simply having the wired interface above the wifi in Network Preferences give it priority?

    Sure there is. Just run an Ethernet cable to the notebook and connect it to the Ethernet port. OS X will fedault to the wired connection and or you can turn off WiFi.
    EDIT:
    I see at the bottom of your post you have a Retina, should of stated that in the header or body of the post.
    You will need either a Thunderbolt to Ethernet or USB to Ethernet adapter to have a Wired connection to your router.

  • How to properly set the environment for user oracle under Linux

    Hi,
    Every time I install XE on Linux somewhere, I repeat these steps (along with [fixing the /etc/init.d/oracle-xe startup script|http://forums.oracle.com/forums/thread.jspa?threadID=843780&tstart=0]), so I thought, why not contribute this to the community.
    Those who have installed XE on Linux know that, after installation, logging in as user oracle gets you in a
    $cryptic prompt. On top of that, none of the essential environment variables are set. Not amusing. That's because the oracle user lacks the proper configuration files for the bash prompt. Log in as user oracle and create these:
    .bashrc
    if [ -f /etc/bashrc ]; then
      . /etc/bashrc
    fi.bash_profile
    if [ -f ~/.bashrc ]; then
      . ~/.bashrc
    fi
    . /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/oracle_env.sh
    unset USERNAME.bash_logout
    clearNow log out and then log in again - a nicer prompt, and all environment variables are set, ready to run sqlplus, imp, etc.
    This should help make your overall XE experience on Linux easier. Regards,
    Georger

    Nice. I checked the .bash_profile of my oracle installation and this is what I can contribute (I got the additional stuff from some tests with other Oracle Versions):
    # /etc/skel/.bash_profile
    # This file is sourced by bash for login shells.  The following line
    # runs your .bashrc and is recommended by the bash info pages.
    [[ -f ~/.bashrc ]] && . ~/.bashrc
    # Oracle Profile Settings
    if [ $USER = "oracle" ]; then
       source /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/oracle_env.sh
       if [ $SHELL = "/bin/ksh" ]; then
          ulimit -p 16384
          ulimit -n 65536
       else
          ulimit -u 16384 -n 65536
       fi
    fiC.

  • How can i set a path for my deployment files in weblogic server 10.3

    Hi
    How can i set the path for my WAR ,JAR files while deploying.i am using the wls10.3 version.
    is there any scripts for this ,please provide me.
    my Application is ADF 11g application.

    By "path", I assume you mean "classpath".
    The simplest way is simply to include the jars you need inside the web application or web module's WEB-INF/lib directory, EJB module's META-INF/lib directory, or EAR lib directory.
    If that's not practical, if you use NodeManager to start your servers, you can go to the "Server Start" tab in the server definition in the WebLogic console and edit the "Classpath" field, which defaults to no value. You can specify a classpath value there. Note that if you specify a value there, it REPLACES the default classpath for the server, it doesn't add to it. If you need to just add to it (a much more likely scenario), if the value references the value "$CLASSPATH" in it, that will reference the original classpath value that the server would have had.
    So, for instance, if you wanted to include the MQ jars in the server classpath, you could set a value like this:
    /usr/java/mq/lib/mq.jar:/usr/java/mq/lib/mqstuff.jar:$CLASSPATH

  • How to set the PATH in Terminal?

    As a newbie to Bash and the Terminal, in connection with installing a new version of Ruby and various add-ons, I have been messing around with changing the PATH via various methods I've found on the internet, and trying to add a new directory to my PATH. Unfortunately, I cannot figure out how to set the PATH correctly. Here is what I understand so far:
    1. Bash first looks to ".bash_profile" in the home directory for PATH settings.
    2. If none, Bash then looks to ".bash_login" for PATH settings.
    3. If none, Bash then looks to ".profile".
    4. If none, Bash then looks to a system file in "/etc/profile" for default PATH settings.
    5. For a new shell after login, Bash looks for a ".bashrc" file.
    I cannot find any of the above files (I have Finder set to show hidden files already). Somehow, following some instructions from the internet without really knowing what I was doing over the past week I have set my PATH as follows:
    /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/*****/src:/usr/X11/bin
    but I cannot find the file that is setting this PATH. I have tried creating a new ".bash_profile" shell file and putting it in various places such as "/bin" and "/usr/bin" but the file is not being read.
    * As a temporary workaround I tried using the command "source .bash_profile" upon login to set the PATH using the .bash_profile file that I created, but it does not work.
    * I am able to temporarily alter the path using the command "PATH=/usr/local/bin:$PATH" but this only lasts for an active shell; when I close out and reopen a new shell, it reverts to the default.
    So my questions are:
    Is it correct that there is a "/etc/profile" somewhere that is setting the default PATH? If so where is it? Should I alter it, or create a new ".bash_profile" somewhere to set the PATH? If not, where is my PATH being set? If I should create a new ".bash_profile", what exactly should go in it?
    Thanks in advance for any assistance.

    ... I created a new ".bash_profile" file directly under my home directory and it worked like a charm. Below is the content of the file:
    "PATH=/usr/local/bin:/bin/:/sbin/:/usr/bin/:/usr/sbin/:/Users/******/Ruby:/Users/*******/src:/Users/******/Java Programs/"
    What are the "..."'s? Is that just you, or is the contents of the file actually inside of double quotes?
    is there an 'export PATH' also in the file? As in
    PATH=/usr/local/bin:/bin/:/sbin/:/usr/bin/:/usr/sbin/:/Users/******/Ruby:/Users/*******/src:/Users/******/Java Programs/
    export PATH
    And did you either restart your Terminal session so your .bash_profile was read, or issue a 'source .bash_profile' command to execute the .bash_profile after your change?
    The only remaining problem is that from the home directory, I'm unable to directly run programs in the above-designated subdirectories (without first navigating to the subdirectory containing the file. Is there something wrong with the syntax or order of the directories I put in the path?
    For example: there is a file called "newprogram.rb" in the "Ruby" directory listed above. I should be able to execute it from the home directory using "ruby newprogram.rb" but it does not work. The same command works fine from within the "Ruby" directory.
    Does the 'ruby' command search PATH to find its scripts?
    Have you read the "man ruby" man page to see if it talks about PATH?
    A common Unix feature is that programs and scripts with the executable bit set, and are located in a PATH directory, will be run if you just type their names.
    For example, if the first line of newprogram.rb script starts with
    #!/usr/bin/ruby
    and if the script is executable
    chmod +x newprogram.rb
    And if it is in a directory in PATH, then just typing
    newprogram.rb
    should run your perl script using /usr/bin/ruby. If you want to use a different version of Ruby, then change the #! line so it point to your version of Ruby. Or if your version of Ruby is found earlier in PATH then the /usr/bin/ruby, you can use
    #!/usr/bin/env ruby
    as your script's first line which will search PATH for 'ruby' and use the first one it finds.
    Message was edited by: BobHarris

  • How to set the path variable on Windows ME?

    I want to get a friend of mine to start using java the only problem is that we both dont know how to set the path variable in Windows ME. I cant seem to find any instructions on it for ME. So if someone could please tell me how or give me a llnk to directions for Windows ME. Thanks.

    Refer to the Installation Instructions for the package that you installed - I believe #5 if the instructions has the information. A link to the instructions is at the page you installed from.

  • How do I set the thumbnail image of my videos that export to my computer?  I'm using Premiere Elements 11 on a windows 8.1 PC 64bit.

    How do I set the thumbnail image of my videos that export to my computer?  I'm using Premiere Elements 11 on a windows 8.1 PC 64bit.
    Or how does Premiere 11 determine where to set the image for the video it is exporting? 
    I already know how to use Freeze frame and save the image to my computer by Publish+Share/Computer/ Immage.
    Thanks,
    Mike

    Mike
    This is not Adobe. Rather user to user. We are all visitors here.
    Just a bit of history....back in the days of Premiere Elements 4, you could set a "poster frame" in what was called the Project area. You did this by right clicking a blank area there and, from the drop down menu that appeared, selecting View/Preview Area, and using the poster frame feature there.
    As I said, when a video imports into Premiere Elements, the thumbnail of the import has been presenting as the first frame of the video. With this Preview area "poster frame" option, you could set the video's thumbnail in the Project area so that the first frame was another frame in the video. But, this "perk" was restricted to thumbnails of the video in Project area.
    If you exported to file with the first frame modified video, the export's thumbnail in Windows Explorer would present with other than the real first frame or the poster frame as the first frame.
    Also, in more recent versions, I have observed that the export to file does not display the real first frame of the video in Windows Explorer. Seems random, but I have not kept track.
    And, remember, at the onset I wrote
    As far as I have ever seen, Premiere Elements Windows uses the first frame of the video for its thumbnail in the program.
    I know of no way within Premiere Elements to control what the program opts to do in this matter. In some compatibility
    issues, it opts to give no image but a generic one.
    I did not say that you can expect to have the Premiere Elements' export file's thumbnail in Windows displaying with its real first frame. And, the more you get into this, depending on the versions, more details need to be added to my comment about "...first frame of video for its thumbnail in the program..."
    I would have to look into all this further to get perspective on the contributing factors.
    ATR
    Add On...The Poster Frame feature appeared in versions 4, 7, 8, and 9 by my count.

  • ICloud accidentally set-up with erroneous email acct. How do I reset the email originally used to start the Apple ID? I'm stuck in a loop...

    Hi Apple friends! Here's my frustrating situation. When I got the new computer (2012 Macbook Pro), I tried to set up iCloud but accidentally input an erroneous email acct. I cannot access iClod because the email was accidentally input as "[email protected]", not "[email protected]". How do I reset the email originally used to start the Apple ID? I'm stuck in a loop, and not only cannot use iCloud, but I keep getting messages popping up to register my iCloud with a non-existent email...
    Help?
    Sincerely,
    Cole
    [email protected]

    Have you tried to go into System Preferences > iCloud and entering the correct information there? You will first have to "sign out" of the wrong account and then log in with the correct information.
    If that does not work you should direct follow up to the iCloud for Mac forum.

  • How do I set the audience when I'm using Siri on my iPhone 5 to post to Facebook

    How do I set the audience privacy for when I’m using Siri on my iPhone 5 to post to Facebook?
    When I ask Siri to post a message to my Facebook Siri tells me what I have said and then asks tot post it, I then checked on my computer and the post is visible to "ME ONLY" I can change this on the computer and on my phone via the App but I do not want to be doing that all the time.
    If I post to Facebook via Siri on my iPhone 5 I want it at the default setting of friends only.
    So How do I change this?
    I posted the first one 2 minutes ago then went into Facebook via the App and changed it but did a second one hoping that the default privacy had changed but it was again to me only. As you can see via the padlock. Please help. Thanks

    What if you do need help or emergency situation while Posting FB via Siri is the fastest way to show you or someone is in danger, and he/she is dying because the post is Only visible to Me !?!?!?!???
    Anyone who uses FaceBook to get immediate help for life threatening emergency is mercifully removing themselves from the gene pool.

  • How do I set the "reply to" field in the iPad 2 Mail app?  I use an email forwarding service (not an actual email account) that I would like people to reply to.

    How do I set the "reply to" field in the iPad 2 Mail app?  I use an email forwarding service (not an actual email account) that I would like people to reply to, so setting up an account with the correct reply-to address doesn't work because there's no associated outgoing mail server.  I had this working under iOS4 but it seems to have disappeared when I upgraded to iOS5.

    Welcome to the forum, NicoleYM. I don't think the Touch Mail has as many options as the Mac Mail app. However, you could set a standard signature. Go to Settings > Mail, Contacts, Calendars > Signature. There you can type a reply address and hope people see it.
    Alternatively, you can go to your GMail account in your web browser and click on Settings > Forwarding and POP/IMAP. There you will have an option to forward all emails (or only some, if you set up a filter) to your other address.
    Good luck!

  • How do i set the proxy user in FF 3.6.13, this entry was existing earlier its gone now. using IE with entries in user account pwds works while FF doesn't.

    How do i set the proxy user in FF 3.6.13.
    previous versions had an entry for proxy user.
    its gone now.
    using IE with entries in user account pwds works while FF doesn't.
    too bad have to change back to IE :-(

    You can find the connection settings in Tools > Options > Advanced : Network : Connection
    See "Firefox connection settings":
    *[[Firefox cannot load websites but other programs can]]

  • How do I set the HELP menu to use Indesign's local HELP files on the hard drive and not the web?

    How do I set the HELP menu to use Indesign's local HELP files on the hard drive and not the web?
    CS 5.0 launches the internet browser.  > TO SLOW I DONT WANT THIS.
    CS 3.0 uses the local help files > I WANT THIS FOR 5.0.

    You're not speaking to the right forum for your request. Help is a Suite-wide feature and here is the forum where the Help application is discussed, and where the proper Adobe people hang out:
    Community Help Application

  • How do you set the amount of time the screen stays lite after your last use?

    How do you set the amount of time the screen stays lite after your last use?

    Settings>General>Auto-Lock.

  • OK, for the third time writing this this session, after setting up iCloud on my IPMini, how do I access the clod to use the iWork apps?

    OK, for the third time writing this this session, after setting up iCloud on my IPMini, how do I access the clod to use the iWork apps?

    Note that you can not log into iCloud.com through the browser on an iOS device, only from a computer. If you want to use the iWork apps on your iOS device, you will need to purchase the apps from the app store if you don't qualify to get them for free.

Maybe you are looking for

  • Can you connect 2 separate apple tv in same house?

    can you conndct 2 separate apple tv in same house? ( only one apple  computor)

  • Open Item Managment problems.

    HI ALL, I have to create normal GL account, now i want to change reconciliation account. then I changed the gl account balance zero. eventhough I got a error Account balance =0 but Open Item exist in GL Saw so many solution in google, but I could not

  • New form opens up in back of Menu Form in Web Deployed Form

    Hi, I am having trouble with my web-deployed form. I have one form that has toolbars and after selecting from the menu for another form to open up, the new form opens up in back of the previous form and I'd have to minimize the previous form in order

  • Useful Benefits of Upgrading From Windows 7 Pro to 10 Pro?

    We'll for IT supporting business; for the most part Windows 7 is still far superior to Windows 8.x.Windows 10 will have to make good on the promise of better and more effective security features, getting the touch interface out of our faces and putti

  • Read data from STATIC internal table during round trip in DO_PREPARE_OUTPUT

    Dear Gurus I have a requirement where I need to select some data from the database table BUT_HIER_NODE_D. After SELECTING this data to an internal table (say ITAB), I am displaying this data in a table view. I was able to achive this functionality by