![]() Which mysql5 # should be /opt/local/bin/mysql5 Which php5 # should be /opt/local/bin/php Make sure that the paths are correctly set after reloading your terminal session by running the following tasks in your terminal: echo $PATH # should include the settings above Reload your Terminal Session by closing and opening you Terminal. nano ~/.profileĬonfirm the following path is added: PATH=/opt/local/bin:/opt/local/sbin:/opt/local/apache2/bin:/opt/local/lib/postgresql91/bin:$PATHįor lion you might also need to add the following to the profile (if you are getting the "libphp5.so requires version 8.0.0 or later" error): export DYLD_LIBRARY_PATH=/opt/local/libĮxport DYLD_FALLBACK_LIBRARY_PATH=/opt/local/lib:/sw/lib:/usr/lib from MAMP or other packages), you'll want to set your shell $PATH properly. To avoid conflicts with other installed binaries (e.g. Then run the following command to load the above changes from. PostgreSQL: alias pgstart="sudo su postgres -c '/opt/local/lib/postgresql91/bin/postgres -D /opt/local/var/db/postgresql91/defaultdb'"Īlias pgstop="sudo su postgres -c '/opt/local/lib/postgresql91/bin/pg_ctl stop -D /opt/local/var/db/postgresql91/defaultdb'" profile file: alias apache2ctl='sudo /opt/local/apache2/bin/apachectl'Īlias mysqlstart='sudo /opt/local/bin/mysqld_safe5'Īlias mysqlstop='/opt/local/bin/mysqladmin5 -u root -p shutdown'Īlias mysqladmin='/opt/local/bin/mysqladmin5' Path Info and Command Aliases sudo nano ~/.profileĪdd the following commands to the. Install SQLite sudo port install sqlite3 php5-sqlite If the second command above didn't work, try this to force creation of the user: sudo port destroot postgresql91-server Sudo su postgres -c '/opt/local/lib/postgresql91/bin/initdb -E utf8 -D /opt/local/var/db/postgresql91/defaultdb' Sudo chown postgres:postgres /opt/local/var/db/postgresql91/defaultdb Set up the initial database structure: sudo mkdir -p /opt/local/var/db/postgresql91/defaultdb Install PostgreSQL sudo port install postgresql91 postgresql91-server php5-postgresql If you get a bunch of 'install ok: channel.' messages then the installation was correct. Set up PEAR and PHPUnitįollow the below commands: sudo pear update-channels Make sure you confirm that each file does exist in the above places. Pdo_fault_socket = /opt/local/var/run/mysql5/mysqld.sock fault_socket = /opt/local/var/run/mysql5/mysqld.sock To use mysqlnd with a local MySQL server, edit /opt/local/etc/php5/php.ini, search for each socket and change as below: fault_socket = /opt/local/var/run/mysql5/mysqld.sock Open php.ini and make the following changes date.timezone = Pacific/Auckland ![]() Run the following command: sudo cp /opt/local/etc/php5/php.ini-development /opt/local/etc/php5/php.ini Sudo nano /opt/local/apache2/conf/nfĪdd this line to the bottom of the nf file: Include conf/extra/mod_php.conf ![]() sudo port install subversion git-core bash_completionĮnable PHP support in Apache sudo /opt/local/apache2/bin/apxs -a -e -n "php5" libphp5.so This is particularly useful for cutting-edge dependencies like piston, which is quite sensitive to its git version. You might already have these dependencies, but chances are that the Macports packages have newer versions. sudo port install php5 apache2 pear fastcgi mysql5 mysql5-server php5-mysql php5-mssql php5-gd php5-mbstring php5-openssl php5-iconv curl ssl php5-curl php5-ldap \php5-mcrypt php5-tidy php5-posix php5-soap php5-xcache php5-xdebugĬaution: This will compile everything from source, taking between 30 and 90 minutes depending on your hardware.Ī list of all available MacPorts PHP 5 modules is available, should you require additional functionality such as SOAP, or other database support. If you do, then the installation won't work. Install Apache, PHP5 and MySQL:īefore you install, please ensure that you don't have the binaries of XAMPP or MAMP in your path (go to nano ~/.bash_profile to check). Similar instructions to this can be found on the MacPorts wiki. If you're interested in how MacPorts works, consider reading the documentation for it here. This will be a good test to see if MacPorts was installed properly:sudo port -v selfupdate. ![]() Install Command line tools in xcode (open xcode -> Preferences -> Downloads -> Command Line tools).Install Apache 2, MySQL 5 and PHP 5 on Mac OS X using MacPorts: Preparation ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |