gd2 not showing in phpinfo, is showing in php -i - gd

I'm trying to get the gd2 extension to work on a WAMP stack (Win7(x64), Apache 2.4, PHP 5.3.26)
I've enabled extension=php_gd2.dll in php.ini and restarted Apache.
I believe my extension directory is reachable as I'm able to load other extensions (eg., curl, mbstring, etc.,) from the same location.
Oddly, php -i lists gd as enabled, but there's no mention of it in phpinfo():
gd
GD Support => enabled
GD Version => bundled (2.1.0 compatible)
FreeType Support => enabled
FreeType Linkage => with freetype
FreeType Version => 2.4.10
GIF Read Support => enabled
GIF Create Support => enabled
JPEG Support => enabled
libJPEG Version => 8
PNG Support => enabled
libPNG Version => 1.2.50
WBMP Support => enabled
XPM Support => enabled
libXpm Version => 30411
XBM Support => enabled
Directive => Local Value => Master Value
gd.jpeg_ignore_warning => 0 => 0
Any ideas?
Will update if I find a solution, and many thanks in advance!
Nao

Related

ValueError: URL must include a 'scheme', 'host', and 'port' component

Trying to use elastic search for a project.
from elasticsearch import Elasticsearch
es = Elasticsearch(
"https://example.com",
http_auth=("abc", "bcd"),
)
But getting the error:
ValueError: URL must include a 'scheme', 'host', and 'port' component (ie 'https://localhost:9200')
I am running this on Pycharm CE and have created a Virtual Environment of Python 3.9 .
Should I be using a different version of Python to make this work??
Moreover, I have already tried pip install acryl-datahub[datahub-rest,elasticsearch]==0.8.27.1 but to no avail.
I was facing the same error. Installing ES version 7.17 solved the problem. I was also getting a not available on pip install acryl-datahub[datahub-rest,elasticsearch]==0.8.27.1. Tried with the next one available (0.8.28.0) and realized it was downgrading elasticsearch to 7.17.
So try pip install elasticsearch==7.17.

Install Phalcon on MAMP PRO 4 (OS X Sierra + Homebrew)

I'd like to start to use Phalcon on my server but I'm getting some issue installing it on MAMP PRO.
1) The server is running PHP 7.1 located in /Applications/MAMP/bin/php/php7.1.1
1.1) on terminal:
php -v return
PHP 7.1.1 (cli) (built: Jan 23 2017 15:09:57) ( NTS )
2) inside this directory I created a subdirectory /include/php and here here I downloaded the content of http://php.net/get/php-7.1.6.tar.bz2/from/a/mirror
3)
cd /Applications/MAMP/bin/php/php7.1.1/include/php
3.1)
./configure --without-iconv
3.2) I got "Thank you for using PHP"
4) From info listed here Phalcon:install (OSX + Brew )
# OS X (Homebrew)
brew tap homebrew/dupes
brew tap homebrew/versions
brew tap homebrew/php
brew install php7x php7x-phalcon
5) Compiling Phalcon as
git clone --depth=1 git://github.com/phalcon/cphalcon.git
cd cphalcon/build
sudo ./install
Then I got: Thanks for compiling Phalcon!
6) Now I have to tell to server to use the new extension so I created a info php page to get the right place to update php.ini
<?php
echo php_ini_loaded_file();
phpinfo();
?>
and it says...
Library/Application Support/appsolute/MAMP PRO/conf/php.ini
...
PHP Version 7.1.1
...
7) Finally on terminal I update the php.ini
sudo vi /Library/Application Support/appsolute/MAMP PRO/conf/php.ini
I got an empty file (!) so I try to load the php7.1.1.ini and it it's full so I add at last line
extension=phalcon.so
8) restart the server ( to be sure I restart MAMP PRO)
But it doesn't works... reloading the phpinfo() Phalcon is missing... and if I go on my Phalcon pages I got
Fatal error: Uncaught Error: Class 'Phalcom\Config' not found
If I run
php -v
I got this warning:
Warning: PHP Startup: Unable to load dynamic library '/Applications/MAMP/bin/php/php7.1.1/lib/php/extensions/no-debug-non-zts-20160303/phalcon.so' - dlopen(/Applications/MAMP/bin/php/php7.1.1/lib/php/extensions/no-debug-non-zts-20160303/phalcon.so, 9): image not found in Unknown on line 0
PHP 7.1.1 (cli) (built: Jan 23 2017 15:09:57) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
But if I comment the last line in php.ini the warning disappear.
Can you help me to understand what's wrong ?
Thanks :)
You can to build by hand. Just git clone cphalcon:
$ php -v
PHP 7.1.5 (cli) (built: May 13 2017 13:30:32) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
$ ls -al /usr/local/bin/phpize
lrwxr-xr-x 1 sergheiiakovlev admin 35 May 16 15:07 /usr/local/bin/phpize -> ../Cellar/php71/7.1.5_17/bin/phpize
$ ls -al /usr/local/bin/php-config
lrwxr-xr-x 1 sergheiiakovlev admin 39 May 16 15:07 /usr/local/bin/php-config -> ../Cellar/php71/7.1.5_17/bin/php-config
$ cd build
$ ./install
$ php --ri phalcon
phalcon
Web framework delivered as a C-extension for PHP
phalcon => enabled
Author => Phalcon Team and contributors
Version => 3.2.0
Build Date => Jun 21 2017 20:33:47
Powered by Zephir => Version 0.9.9-868cb1f92b
Directive => Local Value => Master Value
phalcon.db.escape_identifiers => On => On
phalcon.db.force_casting => Off => Off
phalcon.orm.events => On => On
phalcon.orm.virtual_foreign_keys => On => On
phalcon.orm.column_renaming => On => On
phalcon.orm.not_null_validations => On => On
phalcon.orm.exception_on_failed_save => Off => Off
phalcon.orm.enable_literals => On => On
phalcon.orm.late_state_binding => Off => Off
phalcon.orm.enable_implicit_joins => On => On
phalcon.orm.cast_on_hydrate => Off => Off
phalcon.orm.ignore_unknown_columns => Off => Off
phalcon.orm.update_snapshot_on_save => On => On
phalcon.orm.disable_assign_setters => Off => Off

brew install nginx,how to change nginx.conf file location?

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.

How to set up phpimagik in Mac OS X?

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

imread() stopped working on Octave

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

Resources