sb2nov / mac-setup

Installing Development environment on macOS
https://sourabhbajaj.com/mac-setup/
Other
7.19k stars 1.02k forks source link

Add PHP language setup with mcrypt or any other module #56

Open sdavara opened 8 years ago

sb2nov commented 8 years ago

@sdavara do you want to make a PR to take this on ?

sdavara commented 8 years ago

I have that instruction as below:

Installation on local machine (Mac)

Install php 5.4 and MySQL through homebrew. Follow instructions from homebrew-php for specific installation instructions on your OS.

brew tap homebrew/dupes brew tap josegonzalez/homebrew-php

Update homebrew formulas and install PHP 5.5

brew update xcode-select --install brew install php55 --with-thread-safety --with-mysql brew install php55-mcrypt mysql

Set precedence of newly installed php over system php. Modify your ~/.bash_profile or ~/.zshrc (for bash and zsh respectively) and add the following at the bottom:

PATH=/usr/local/bin:$PATH

Set timezone in php.ini. It should be located at /usr/local/etc/php/5.4/php.ini.

Install PHP Composer

curl -sS https://getcomposer.org/installer | php mv composer.phar /usr/local/bin/composer

sdavara commented 8 years ago

I'll see, If I can create a PR with PHP and composer(it's package manager)

sb2nov commented 8 years ago

@sdavara thanks for taking this on, would love to help with the PR whenever you create it.

sb2nov commented 8 years ago

@sdavara ping^

Kyslik commented 7 years ago

Is it necesssry to have php 5.5 guide?

What OS X version should this be for? (I am still on Yosemite)

Kyslik commented 7 years ago

Anyone who wanders here and have not seen stack overflow question on this topic here is a link: https://stackoverflow.com/questions/26493762/yosemite-el-capitan-php-gd-mcrypt-installation

Kyslik commented 7 years ago

In case you need only one version (5.6 or 7.x..) just install it using guide linked above (stackoverflow). In case you need 2 versions simultaneously you have multiple options: https://medium.com/@wvervuurt/how-to-run-multiple-php-versions-simultaneously-under-os-x-el-capitan-using-standard-apache-98351f4cec67 or https://getgrav.org/blog/macos-sierra-apache-multiple-php-versions or (advanced, since guide is not for macOS but for Linux, but gives you the idea) https://pehapkari.cz/blog/2017/03/27/multiple-php-versions-the-easy-way/

Kyslik commented 6 years ago

New suggestions if you develop using some kind of framework/library... use Valet

Laravel, Lumen, Bedrock, CakePHP 3, Concrete5, Contao, Craft, Drupal, Jigsaw, Joomla , Katana, Kirby, Magento, OctoberCMS, Sculpin, Slim, Statamic, Static HTML, Symfony, WordPress, Zend

Kyslik commented 5 years ago

I do not really know how to proceed here; I just use Valet and it does all the stuff behind the scenes for me (for my use case). Using Valet is easy, but it does not support development with no frameworks (see list in https://github.com/sb2nov/mac-setup/issues/56#issuecomment-348523220).

I also use brew pining for PHP so it does not upgrade to PHP 7.3.

Also PHP 7.2 comes with these modules, and the trouble ones (intl, mcrypt) are either built-in statically or depreciated:

➜  ~ php -m
[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dba
dom
exif
fileinfo
filter
ftp
gd
gettext
gmp
hash
iconv
intl
json
ldap
libxml
mbstring
mysqli
mysqlnd
odbc
openssl
pcntl
pcre
PDO
pdo_dblib
pdo_mysql
PDO_ODBC
pdo_pgsql
pdo_sqlite
pgsql
Phar
phpdbg_webhelper
posix
pspell
readline
Reflection
session
shmop
SimpleXML
soap
sockets
sodium
SPL
sqlite3
standard
sysvmsg
sysvsem
sysvshm
tidy
tokenizer
wddx
xml
xmlreader
xmlrpc
xmlwriter
xsl
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcache
sb2nov commented 5 years ago

@Kyslik want to just turn your guidelines into a Php page? Since I think you've enough experience with this as well as there is not much we can do beyond this on the issue.

simeg commented 5 years ago

@Kyslik Not knowing much about PHP and the ecosystem of the language I think anything would be useful, like how do I install PHP and manage versions? And if you think Valet is a good choice then I'd say include that!