---
title: PHP, Net-SNMP and OS X 10.10.5
date: 2015-07-16T19:28:17+00:00
modified: 2015-07-16T19:32:49+00:00
permalink: https://kaspars.net/blog/php-netsnmp-os-x
post_type: post
author:
  name: Kaspars
  avatar: https://reverse.kaspars.net/gravatar/avatar/92bfcd3a8c3a21a033a6484d32c25a40b113ec6891f674336081513d5c98ef76?s=96&d=mm&r=g
category:
  - Development
post_tag:
  - How to
  - PHP
---

# PHP, Net-SNMP and OS X 10.10.5

Today I upgraded to the [latest “Public Beta” of OS X 10.10.5](http://www.macrumors.com/2015/07/16/apple-seeds-osx-10-10-5-public-beta/) and suddenly PHP CLI was returning the following error:

```
$ php
dyld: Library not loaded: /usr/lib/libnetsnmp.25.dylib
  Referenced from: /usr/bin/php
  Reason: image not found
Trace/BPT trap: 5
```

so I checked the contents of the `/usr/lib` folder and discovered some recent changes to the [Net-SNMP libraries](https://en.wikipedia.org/wiki/Net-SNMP):

```
$ ls -la /usr/lib/libnetsnmp.*
lrwxr-xr-x  1 root  wheel       28 Jul 16 21:55 /usr/lib/libnetsnmp.25.dylib -> /usr/lib/libnetsnmp.30.dylib
-rwxr-xr-x  1 root  wheel  1241136 Jul  9 10:38 /usr/lib/libnetsnmp.30.dylib
lrwxr-xr-x  1 root  wheel       19 Jul 16 13:04 /usr/lib/libnetsnmp.dylib -> libnetsnmp.30.dylib
```

## The Solution

Symlinking `libnetsnmp.25.dylib` to the latest version of `libnetsnmp.dylib` fixes the issue:

```
$ sudo ln -s /usr/lib/libnetsnmp.dylib /usr/lib/libnetsnmp.25.dylib
```

I wonder why they didn’t update PHP to match the system changes:

```
$ php -v
PHP 5.5.24 (cli) (built: May 19 2015 10:10:05) 
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies
```