Skip to content

Instantly share code, notes, and snippets.

View sophiaphillipa's full-sized avatar

Sophia Phillipa sophiaphillipa

View GitHub Profile
@sophiaphillipa
sophiaphillipa / compile_php_mongodb_driver.md
Last active March 15, 2019 18:57
Compile PHP MongoDb Driver for php 7 (even if you have more than one php on env)

Compile PHP MogoDbDriver for php 7

This gist took PHP - Manually Installing the MongoDB PHP Driver, as reference.

First locate your php-config file. To do so, you can trace it with locate php-config. It will be something like this:

/usr/php/7.0.9/exec/bin/php-config

It's the file that has all compiled php settings, and it will be used to tell config command, wich PHP should be compiled for.

For any dificult in update node.Js
$ sudo n 6.
$ sudo npm install -g npm@3.10.0
$ sudo npm install -g npm@next
$ sudo n 7.
@sophiaphillipa
sophiaphillipa / Dockerfile
Last active May 15, 2022 06:39
Configuring PHPStorm to work with xDebug and Docker, by listening.
FROM php:7-fpm
RUN apt-get update && \
apt-get install -y \
zlib1g-dev \
libfreetype6-dev \
libjpeg62-turbo-dev \
libmcrypt-dev \
libpng12-dev
@sophiaphillipa
sophiaphillipa / runapp.php
Last active February 18, 2017 17:50
How to run outside applications on windows, using PHP
<?php
/*
* Running App on Windows SO
*
* There is some dificult on running apps trought PHP inside windows SO.
* Here are two methods that can make it easy
*
* @author Michel Phillipe
* @version 1.0
-- Downloading and compile - just php-fpm be sure to not use: --with-apxs2=/usr/sbin/apxs as this would replace apache php
wget http://am1.php.net/get/php-5.6.18.tar.gz/from/this/mirror
tar -xzf php-5.6.18.tar.gz
cd php-5.6.18
./configure --prefix=/usr/php/5.6.18 --exec-prefix=/usr/php/5.6.18/exec --sysconfdir=/etc/php56 --localstatedir=/var --datadir=/usr/share/php --mandir=/usr/share/man --enable-fpm --with-fpm-user=nginx --with-fpm-group=nginx --with-config-file-path=/etc/php56 --with-zlib --enable-bcmath --with-bz2 --enable-calendar --with-gdbm --with-gmp --enable-ftp --with-gettext --enable-mbstring --with-readline --with-mysql --enable-pdo --with-pdo-mysql=mysqlnd --with-mysql-sock=/var/lib/mysql/mysql.sock
make
make install
-- Address to treat errors:

Reference:https://coolestguidesontheplanet.com/install-mcrypt-php-mac-osx-10-10-yosemite-development-server/

Install mcrypt for php on Mac OSX 10.10 Yosemite for a Development Server

October 16, 2014 111 Comments

mcrypt is a file encryption method using secure techniques to exchange data. It is required for some web apps for example Magento, the shopping cart software or a php framework like Laravel. This tutorial has been tested in OSX 10.10 Yosemite.

This guide is really for users with the version of PHP that shipped with OSX Yosemite which is version 5.5.14. Other downloadable AMP stacks already have mcrypt baked in.

@sophiaphillipa
sophiaphillipa / delegates.xml
Last active May 31, 2023 15:18
ImageMagick how to convert EPS to PNG with Quality and Transparency
<!--
To dicovery where is delegates convert -list delegate
Must pass this commands to GS: -dUseCIEColor -sDEVICE=pngalpha
-->
<delegate decode="ps:cmyk" stealth="True" command="&quot;gs&quot; -q -dQUIET -dUseCIEColor -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 &quot;-sDEVICE=pngalpha&quot; -dTextAlphaBits=%u -dGraphicsAlphaBits=%u &quot;-r%s&quot; %s &quot;-sOutputFile=%s&quot; &quot;-f%s&quot; &quot;-f%s&quot;"/>
@sophiaphillipa
sophiaphillipa / crossBrowserRequest.js
Last active January 29, 2016 16:34
Cross Browser Request with JSONP and PHP
$.ajax({
type: 'GET',
url: 'jsonpAnswer.php',
data: {
form: $(this).serialize()
},
dataType: 'jsonp',
crossDomain: true,
}).done(function(response){
switch(response.type){
Makes a tunnel into local port to the host ip port
ssh -fNg -L 3307:127.0.0.1:3306 vagrant@localhost -p 2222