0

This issue started just after I upgraded my Mac to OS X El Capitan. Before that it was working just fine.

I am using XAMPP and Oracle Instant Client was properly set up to connect with Oracle DB. I followed the instructions mentioned here while installing (click on the question "How do I activate the OCI8/Oracle extension for PHP?").

But, after I upgraded my OS to OS X El Capitan, it started to show this warning,

Warning: oci_connect(): OCIEnvNlsCreate() failed. There is something wrong with your system - please check that DYLD_LIBRARY_PATH includes the directory with Oracle Instant Client libraries

I am searching for solution all over the internet (not only SO), for the last few days and the nearest match I found was this : https://stackoverflow.com/a/20670810/5645769. So, I tried to edit the file org.apache.httpd.plist, as suggessted by the answer. But I was having this error :

You don't own the file "org.apache.httpd.plist" and don't have permission to write to it. You can duplicate this document and edit the duplicate. Only the duplicate will include your changes.

I asked about that to OP and his reply didn't make any help to resolve the issue. So my search for solutions continued. After a few more days of search, I found this post https://stackoverflow.com/a/32910408/5645769. So I followed the instructions to disable SIP (System Intregrity Protection) and I was then able to add write access to the file and containing folder for my account (and also administrator). After that oci_connect() started working again.

But when I disabled the SIP again following the same answer, the same error comes again. I am not sure, but it seems like there is something happening with other file permissions which oci_connect() is trying to use but it can access only when SIP is disabled.

Currently I am working with keeping the SIP disabled (not sure, what harm it may cause), I need a solution which will work while keeping the SIP enabled.

I am spending many days with this. Any help will be highly appreciated.

Community
  • 1
  • 1

1 Answers1

0

/System/Library/LaunchDaemons/org.apache.httpd.plist is only for controlling the behaviour of the Apache server built in to OS X.

To set DYLD_LIBRARY_PATH for the XAMPP version of Apache you'll need to edit its startup script:

sudo nano /Applications/XAMPP/xamppfiles/apache2/ctl.sh

On the second line of the file, after #!/bin/sh you can add whatever you need to:

#!/bin/sh

DYLD_LIBRARY_PATH=/path/to/your/library/files

ERROR=0
HTTPD_STATUS=""
HTTPD_PIDFILE=/Applications/XAMPP/xamppfiles/logs/httpd.pid
HTTPD="/Applications/XAMPP/xamppfiles/bin/httpd -f /Applications/XAMPP/xamppfiles/etc/httpd.conf"

DO NOT disable system integrity protection. It's there for a reason.

miken32
  • 42,008
  • 16
  • 111
  • 154