brew install openresty --with-debug --conf-path=/usr/local/nginx/conf/nginx.conf
but it no effect.
nginx -V
nginx version: openresty/1.9.7.4 (no pool)
built by clang 7.3.0 (clang-703.0.31)
built with OpenSSL 1.0.2h 3 May 2016
TLS SNI support enabled
configure arguments: ......--conf-path=/usr/local/etc/openresty/nginx.conf --http-log-path=/usr/local/var/log/nginx/access.log --error-log-path=/usr/local/var/log/nginx/error.log --with-pcre --with-pcre-jit --with-dtrace-probes --with-http_ssl_module
the nginx.conf file location not changed,still is the default.
The option you have specified --conf-path is not a homebrew supported option. You can see that by running this:
brew options openresty
Output
--with-debug
Compile with support for debug logging but without proper gdb debugging symbols
--with-geoip
Compile with ngx_http_geoip_module
--with-gunzip
Compile with ngx_http_gunzip_module
--with-iconv
Compile with support for converting character encodings
--with-postgresql
Compile with support for direct communication with PostgreSQL database servers
--with-stub_status
Compile with ngx_http_stub_status_module
--with-webdav
Compile with ngx_http_dav_module
--without-luajit
Compile *without* support for the Lua Just-In-Time Compiler
I think the only way to do what you want is to edit the formula, so you would do:
brew edit openresty
and then search down for conf-path, and edit the part that looks like this:
args = [
"--prefix=#{prefix}",
"--pid-path=#{var}/run/openresty.pid",
"--lock-path=#{var}/run/openresty.lock",
"--sbin-path=#{bin}/openresty",
"--conf-path=#{etc}/openresty/nginx.conf", <--- HERE
"--http-log-path=#{var}/log/nginx/access.log",
"--error-log-path=#{var}/log/nginx/error.log",
"--with-pcre",
"--with-pcre-jit",
"--with-cc-opt=#{cc_opt}",
"--with-ld-opt=#{ld_opt}",
]
You may need to do:
brew tap homebrew/nginx
before running the above commands.
Can anyone tell me simple step by step to set up phpimagick in OS X?
Yes, use homebrew. Go to the homebrew website and install it with the one line script there. - I don't want to paste it here because you need the latest and greatest line at the time of following these instructions.
Then, when you have homebrew installed, do these steps to get ImageMagick installed and running under PHP and also with Apache.
# Check all of homebrew is working - fix any errors before proceeding
brew doctor
# Get latest versions of everything if you already had "homebrew" installed
# Probably not necessary if you just installed "homebrew" in previous step
brew update && brew upgrade
# Find latest PHP version - using "brew search"
newestPHP=$(brew search php | grep -E "php[0-9]+$" | sort | tail -1)
echo $newestPHP
e.g. php56
# Install latest PHP and corresponding ImageMagick
brew install ${newestPHP} ${newestPHP}-imagick
e.g. brew install php56 php56-imagick
# Check that the installation worked - you MUST use "/usr/local/bin/php"
/usr/local/bin/php -i | grep -i imag
Output
Additional .ini files parsed => /usr/local/etc/php/5.6/conf.d/ext-imagick.ini
PHP Warning: Unknown: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in Unknown on line 0
imagick
imagick module => enabled
imagick module version => 3.1.2
imagick classes => Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator
ImageMagick version => ImageMagick 6.9.1-1 Q16 x86_64 2015-04-15 http://www.imagemagick.org
ImageMagick copyright => Copyright (C) 1999-2015 ImageMagick Studio LLC
ImageMagick release date => 2015-04-15
ImageMagick number of supported formats: => 204
ImageMagick supported formats => 3FR, AAI, AI, ART, ARW, AVI, AVS, BGR, BGRA, BGRO, BMP, BMP2, BMP3, BRF, CAL, CALS, CANVAS, CAPTION, CIN, CIP, CLIP, CMYK, CMYKA, CR2, CRW, CUR, CUT, DCM, DCR, DCX, DDS, DFONT, DNG, DOT, DPX, DXT1, DXT5, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, ERF, FAX, FITS, FRACTAL, FTS, G3, GIF, GIF87, GRADIENT, GRAY, GV, HALD, HDR, HISTOGRAM, HRZ, HTM, HTML, ICB, ICO, ICON, IIQ, INFO, INLINE, IPL, ISOBRL, JNG, JNX, JPE, JPEG, JPG, JPS, JSON, K25, KDC, LABEL, M2V, M4V, MAC, MAP, MASK, MAT, MATTE, MEF, MIFF, MKV, MNG, MONO, MOV, MP4, MPC, MPEG, MPG, MRW, MSL, MSVG, MTV, MVG, NEF, NRW, NULL, ORF, OTB, OTF, PAL, PALM, PAM, PANGO, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PDFA, PEF, PES, PFA, PFB, PFM, PGM, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG00, PNG24, PNG32, PNG48, PNG64, PNG8, PNM, PPM, PREVIEW, PS, PS2, PS3, PSB, PSD, PWP, RADIAL-GRADIENT, RAF, RAS, RAW, RGB, RGBA, RGBO, RGF, RLA, RLE, RMF, RW2, SCR, SCT, SFW, SGI, SHTML, SIX, SIXEL, SPARSE-COLOR, SR2, SRF, STEGANO, SUN, SVG, SVGZ, TEXT, TGA, THUMBNAIL, TILE, TIM, TTC, TTF, TXT, UBRL, UIL, UYVY, VDA, VICAR, VID, VIFF, VIPS, VST, WBMP, WMV, WPG, X3F, XBM, XC, XCF, XPM, XPS, XV, YCbCr, YCbCrA, YUV
imagick.locale_fix => 0 => 0
imagick.progress_monitor => 0 => 0
That completes the installation if you only want to run ImageMagick under PHP outside your website.
The remaining steps are only necessary if you want to run PHP and ImageMagick under Apache inside your website.
# Check if PHP module loaded in Apache config file - /etc/apache2/httpd.conf
grep "^LoadModule.*php5_module.*libphp.*" /etc/apache2/httpd.conf
Check it matches, or if not present add a line like this
LoadModule php5_module /usr/local/Cellar/php56/5.6.6/libexec/apache2/libphp5.so
# Restart Apache
sudo apachectl restart
I've tried googling it and it seems nobody else has had this kind of error.
I'm using Octave 3.6.1 on Ubuntu 12.04. I've been using the imread() funcion to read images for quite some time, but just yesterday it started throwing this error:
octave:5> I = imread('example.jpg');
error: imread: invalid image file: Magick++ exception: Magick: Unable to open file (tures/example.jpg) reported by coders/jpeg.c:955 (ReadJPEGImage)
error: called from:
error: /usr/share/octave/3.6.1/m/image/imread.m at line 74, column 7
If I try to read a PNG, I get a similar error:
octave:5> I = imread('example.png');
error: imread: invalid image file: Magick++ exception: Magick: Unable to open file (tures/example.png) reported by coders/png.c:2790 (ReadPNGImage)
error: called from:
error: /usr/share/octave/3.6.1/m/image/imread.m at line 74, column 7
Does anybody know what's happening? How to fix this?
Thanks a lot!
I had the same problem with 3.6.4 on Windows 8.1, the simple workaround for me was this:
IMAGE_PATH = ('C:\Users\...');
where the image is stored
Image = file_in_path(IMAGE_PATH, 'image.jpg');
Of course it would be better to fix the actual function, but for now it's good enough.
Hope this helps.
Octave uses GraphicsMagick (or ImageMagick) to handle the reading and writing of images. GraphicsMagick does not handle directly the reading and writing of images, it's a wrapper for the many format libraries under a single API.
When you build GraphicsMagick, it checks your system for available libraries and disables/activates formats as those are presents. You probably built GraphicsMagick yourself without the development libraries libpng and libjpeg. In Ubuntu, I believe those are in the packages libpng12-dev and libjpeg8-dev. Either use the GraphicsMagick libraries that come with your system or if you need to build it yourself, see the instructions in the Octave wiki.
To confirm this is indeed your problem, run gm -version and check if those formats are activated. For example, the output in my system shows:
Feature Support:
Thread Safe yes
Large Files (> 32 bit) yes
Large Memory (> 32 bit) no
BZIP yes
DPS no
FlashPix no
FreeType yes
Ghostscript (Library) no
JBIG yes
JPEG-2000 yes
JPEG yes
Little CMS yes
Loadable Modules no
OpenMP yes (201107)
PNG yes
TIFF yes
TRIO no
UMEM no
WMF yes
X11 yes
XML yes
ZLIB yes