Showing posts with label homebrew. Show all posts
Showing posts with label homebrew. Show all posts

Oct 27, 2016

Apache not loading PHP after SierraOS upgrade (Homebrew way)

Had a hard time dealing with Apache Server + PHP on my Mac right after SierraOS upgrade.

I use homebrew to get my Mac run with latest PHP7 version instead of directly messing around with the original library come with the SierraOS.

Firstly, the latest update of homebrew, PHP module has no longer installed with Apache.
You need:
brew install php70 --with-apache
in order to download the PHP with libphp7.so 
(this is the file you need when you use apache to load php module)

2nd, after you have Apache downloaded with your PHP through homebrew.
All the manual configurations, by default,
have to be done inside /usr/local/etc/apache2/2.4 (yours might be 2.2, based on your installed version).
Remember those httpd.conf, httpd-vhost.conf, etc... they're all inside the /usr/local/etc/apache2/2.4 folder?

and add a missing media type to your mime_module which it's the most obscure step (to a beginner like me) to missed out during configuration.
AddType application/x-httpd-php .php
Symptom check (whether or not to add the line above):
- php module is loaded correctly, but plain php code still showing in your localhost, for instance, php_info() doesn't work

- your sudo apachectl configtest show nothing wrong "Syntax OK"

Mar 28, 2016

Homebrew-ed Postgresql: "Export error: Failed to execute pg_dump"

Problem to troubleshoot
Export error: Failed to execute pg_dump (given path in your conf/config.inc.php : /usr/bin/pg_dump). Please, fix this path in your configuration and relog.

Postgres phppgadmin: Export error
I am new to postgresql database,
and recently I have a chance to play with this technology and at the meantime, I have been facing newbie issues with it.

Since I won't using this tool for a long time, it's better to record down the troubleshooting note for future in the simple way.

I use homebrew to install postgresql and phppgadmin.

As said in the error message, we'll need to edit conf/config.inc.php in order to get it fixed.

1) find your config.inc.php with "mdfind -name config.inc.php"
search for config.inc.php file
2) Find your pg_dump binary file path with "which pg_dump"
pg_dump location
3) Place correct path to "pg_dump" configuration

4) Once you done steps above, remember to relogin your user in phppgadmin for changes above to take effect.