Thank you so much for posting this! After the El Capitan latest beta update my localhost was failing to pull up, with apachectl configtest showing the line with libphp5.so as causing the error. When trying to run php on the command line, I received exactly the error you detailed above. Now all’s fixed thanks to your symlink :) I’m so glad Google picked up your article so quickly (I think it said 32 minutes published!)