# Upgrading to 9.3 And PHP/Apache



## BillFinkNC (Feb 16, 2015)

I've been running a 32bit version of 8.2 for as long as it's been released. ROCK solid SINCE!

The box (finally, hardware-wise bit the big one) but one of the things I should've done and didn't, was to use the AMD64 version, thus making a restore to an AMD64 version wouldn't have been such an issue - but at the time - it didn't seem necessary.

So my issue is now, I've upgraded to 9.3 (AMD64), got it installed, most services up and running just fine with the exception of my compiling some of the ports (spamassassin won't compile either ) - the MOST important one is getting Apache (that came with 9.3) to let/get it to allow access to the folders I've defined in httpd-vhosts.conf file - I always get You Do Not Have Permission To Access / etc..when I go to those VirtualHosts /htdocs folder. (Yes, I've the proper "Directory Directives in the HTTPD.CONF" file.) And I've enabled to use that file, by uncommenting load httpd-vhosts.conf. The permissions on the /usr/local/www/vhosts_go_here I even tried `chmod 777` on that folder, still getting the permission denied issue.) I know, I know, I'll change it when I figure out what's wrong with the Apache that comes with FreeBSD 9.3, I believe it's Apache 2.4.

So I gave up on that, grabbed Apache 2.2 from the Apache Project and now the folder access is no longer an issue. (What changed there? and why would that be?)

Here's my BIGGEST issue - for the life of me, I cannot get Apache to load _any_ PHP modules. I've most of my "VirtualHosts" written in PHP so changing 'em to ALL HTML is nearly impossible.

What happens when I start Apache...


```
httpd: Syntax error on line 53 of /usr/local/apache2/conf/httpd.conf: Cannot load /usr/local/apache2/modules/libphp5.so into server: /usr/lib/libz.so.5: unsupported file layout
```

I compiled the PHP55 that comes inside the ports, no problems, there. Even running `php -v` comes up with all proper information as if it installed just fine.

I do realize that was likely not going to work. (Simply copying my old 32 libphp over from my backup, but gave it a shot.)

If I leave out to load that module, Apache works like a charm. (And WHY would I not get You Do Not Have Permission To / when I fire up Apache 2.4 that came with 9.3?

What is it that I need to do, to get it to use PHP. I tried copying both libphp5.so (which is nowhere to be found, I just put that file from my old backup, knowing it would NOT likely work (32 vs 64 bit) and libz.so.5 - different compilers/libs/etc... but why is permission denied? (Any help there?)

Bottom Line And BIGGER question and need help with is: What do I have to do to get Apache 2.2 and PHP (the PHP that/which came WITH FreeBSD 9.3) to work together.

I'm fluent ENOUGH, but not considered an expert - please go easy on me and assume I need hand-holding directions. (I've tried following others I've found Googlin' but they are for either OLD ways (and BROKE my box once already which I had to reinstall) or for other distributions.

I usually get some sort of alert saying this isn't the proper place to ask this question, so please accept my apologies ahead of time, if this is the case, (again).

I truly appreciate ALL/ANY help you can give me.


----------



## gkontos (Feb 16, 2015)

The default port of Apache has been updated for some sadistic reason to 2.4. However, you can still install from ports the previous version www/apache22. You will need to add the following line to your make.conf --> APACHE_DEFAULT=2.2 and you will also need to install from the ports www/mod_php5. Avoid compiling software that you have downloaded directly and prefer the use of ports instead.

Now, regarding the transition of 32bit to 64bit, I would advise you to make a decent backup and reinstall.


----------



## wblock@ (Feb 16, 2015)

First, you did a major version upgrade, 8.2 to 9.3.  Did you rebuild all ports after that?  If not, that is going to be a source of problems.

Grabbing the source and compiling without using the ports is usually not the right answer.  It can hide the real problem, and you might not get the FreeBSD patches needed by that software.
Similarly, copying or linking libraries is almost always a mistake.  It makes for mysterious errors and problems down the road, long after the linking or copying was done.

Finally, everyone always says they will go back and remove 777 permissions later, it was just to get it working now.  This is another trap that people set for themselves.


----------



## BillFinkNC (Mar 1, 2015)

wblock@ said:


> First, you did a major version upgrade, 8.2 to 9.3.  Did you rebuild all ports after that?  If not, that is going to be a source of problems.
> 
> Grabbing the source and compiling without using the ports is usually not the right answer.  It can hide the real problem, and you might not get the FreeBSD patches needed by that software.
> Similarly, copying or linking libraries is almost always a mistake.  It makes for mysterious errors and problems down the road, long after the linking or copying was done.
> ...




I didn't "upgrade" - sorry wrong choice of words. I COMPLETELY blew away my 8.x box, (It actually failed, but I had a backup of all the files) and just downloaded 9.3, set it up - and still to this day, followed word-for-word, the guidelines at: https://www.iceflatline.com/2011/11/how-to-install-apache-mysql-php-and-phpmyadmin-on-freebsd/

I have Apache24 installed, running rendering pages just fine. I have MySQL installed, following the instructions and installing PHP, that too seemed to install without any issues - running fine, but...

PHP still doesn't render PHP scripts, at all when called upon from a browser. (It's odd, these directions mentions 9.3 but then refers to FreeBSD 10.0-RELEASE.)


----------



## junovitch@ (Mar 2, 2015)

If PHP scripts are not being rendered as scripts but showing as text, then the "SetHandler" keywords to execute them are likely missing.

Shown here, this puts that config in a separate file.  The instructions in the guide you linked show it in httpd.conf which would be fine as well.

```
cat > /usr/local/etc/apache24/Includes/mod_php.conf << 'EOF'
<FilesMatch "\.php$">
    SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch "\.phps$">
    SetHandler application/x-httpd-php-source
</FilesMatch>
'EOF'
```


----------



## BillFinkNC (Mar 2, 2015)

junovitch said:


> If PHP scripts are not being rendered as scripts but showing as text, then the "SetHandler" keywords to execute them are likely missing.
> 
> Shown here, this puts that config in a separate file.  The instructions in the guide you linked show it in httpd.conf which would be fine as well.
> 
> ...


Thanks, and as you mentioned, (and included in that link) I put those statements at the bottom of my httpd.conf file.

However, as you recommended, I created a file /usr/local/etc/apache24/Includes/mod_php.conf - and then inserted those lines into that file.

But it rendered the pages the same way, in text mode. (I don't see where there's any loading of any PHP at all inside my httpd.conf - so how/where is Apache24 knowing where or what to load for PHP rendering?

I don't mind sending my entire httpd.conf (it's the one out of the box, perhaps I _MAY_ be looking at an incorrect httpd.conf file?) Currently it's at: /usr/local/etc/apache24/httpd.conf

Perhaps move those statements up higher inside the httpd.conf? (The source and link I noted stated it's ok to put it at the bottom.)


----------



## junovitch@ (Mar 2, 2015)

Starting from a fresh jail and doing `pkg install www/apache24; pkg install www/mod_php56 lang/php56 ftp/php56-curl textproc/php56-xml converters/php56-mbstring devel/php56-json textproc/php56-simplexml textproc/php56-dom` for what I was using Apache for, it automatically created the entry to load the module.  It should look like this:
httpd.conf

```
# ... LoadModule section
LoadModule php5_module        libexec/apache24/libphp5.so
```
`httpd -t -D DUMP_MODULES` would list the following in the output:

```
php5_module (shared)
```
Your original post had all kinds of non-standard paths that don't make sense from a fresh install of the package. The PHP module error also doesn't make sense.  Did you originally copy your httpd.conf from the prior install or were all those earlier logs from the locally compiled Apache?


----------



## BillFinkNC (Mar 2, 2015)

I was just corrected I'm not posting "properly." - the module

```
# ... LoadModule section
LoadModule php5_module libexec/apache24/libphp5.so
```
Doesn't seem to exist ANYWHERE on my server.

RE: Where I had asked if I could simply get Apache 2.2 going with PHP 5 is where you're (likely) referring to my not making sense. At that point, after following the link how to get them to co-exist (and work) I was willing to downgrade to Apache 2.2 and PHP5.

I have nothing to lose, (I have a complete backup of all the web-pages) I'm going to follow your "starting from a fresh jail" - do exactly what you did, after cleaning and deinstalling, and see if all of a sudden libphp5.so shows up.


----------



## junovitch@ (Mar 2, 2015)

`pkg install apache24 mod_php56` is sufficient to get things started.  The `pkg install mod_php56` command installs PHP as well as adds the "LoadModule" line mentioned above.  It prints the "SetHandler" lines that I mentioned above that need to be added to the screen.

If you have a valid need for older versions and can handle the extra maintenance burden then there's nothing wrong with going that way.  However, PHP 5.4 is no longer supported for bug fixes and security issues will only be fixed for a couple more months.  See http://php.net/supported-versions.php.  I'm not sure what the EOL date for Apache 2.2 is but it makes sense for Apache 2.4 to be the default in the port collection for new installs.

The Apache section of the Handbook, with the minor exception of still referring to www/mod_php5 also looks helpful.
https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/network-apache.html


----------



## BillFinkNC (Mar 2, 2015)

It seems no matter how and what I do, I cannot locate the module that's supposed to be created libphp5.so ANYWHERE on my system. (updated the file index library and tried locate libphp5.so just doesn't show up. I _know_ now that's 99% the issue.

Any other suggestions? I did the `pkg install apache24 mod_php56` and still libphp5.so just doesn't show up. I followed the recommendation two replies above, and still that file is nowhere to be found. How can you load a module you cannot find???

Is there anything else I can mention? I've done this 100 times in the past, this is the first, for me having such a difficult time. Thanks to all who are turning in suggestions.


----------



## junovitch@ (Mar 2, 2015)

What does `pkg info -l mod_php56` say?  I just tried installing it in here is what I see:

```
mod_php56-5.6.6:
    /usr/local/libexec/apache24/libphp5.so
    /usr/local/share/licenses/mod_php56-5.6.6/LICENSE
    /usr/local/share/licenses/mod_php56-5.6.6/PHP301
    /usr/local/share/licenses/mod_php56-5.6.6/catalog.mk
```
It also says during the install that it enables the module during installation.
`pkg install apache24 mod_php56`

```
...
[test-jail.example.com] [10/10] Extracting mod_php56-5.6.6: 100%
[activating module `php5' in /usr/local/etc/apache24/httpd.conf]
Message for apache24-2.4.12:
....
```


----------



## BillFinkNC (Mar 2, 2015)

Awesome! That looked like a winner to me ... however,


```
[root@rmx /usr/ports/www/apache24]# pkg info -l mod_php56
mod_php56-5.6.6:
        /usr/local/libexec/apache24/libphp5.so
        /usr/local/share/licenses/mod_php56-5.6.6/LICENSE
        /usr/local/share/licenses/mod_php56-5.6.6/PHP301
        /usr/local/share/licenses/mod_php56-5.6.6/catalog.mk
```
BUT, when I look into the folder under apache24 there is no libphp5.so


----------



## junovitch@ (Mar 2, 2015)

It's not libphp56.so it's libphp5.so.  Here's what I see.
`ls -al /usr/local/libexec/apache24/libphp5.so`

```
-r--r--r--  1 root  wheel  4107112 Feb 25 15:53 /usr/local/libexec/apache24/libphp5.so
```


----------



## BillFinkNC (Mar 2, 2015)

junovitch said:


> It's not libphp56.so it's libphp5.so.  Here's what I see.
> `ls -al /usr/local/libexec/apache24/libphp5.so`
> 
> ```
> ...



My bad (and I edited my post) you're correct just typed '56' and '5' so many times over the past week, it's difficult, but still, it's just NOT there. I even go to both ports folders desinstall them and try and try and try again. That file just isn't anywhere.


----------



## BillFinkNC (Mar 2, 2015)

Does this help in any way? I just discovered there's something else not quite right!!!

```
[root@rmx /usr/ports/www/mod_php56]# make deinstall
===>  Deinstalling for mod_php56
===>   Deinstalling mod_php56-5.6.6
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 1 packages (of 0 packages in the universe):

Installed packages to be REMOVED:
        mod_php56-5.6.6

The operation will free 4 MiB.
[1/1] Deinstalling mod_php56-5.6.6...
/usr/local/sbin/apxs: not found
pkg-static: DEINSTALL script failed
[1/1] Deleting files for mod_php56-5.6.6:   0%
pkg-static: unlinkat(usr/local/libexec/apache24/libphp5.so): No such file or directory
[1/1] Deleting files for mod_php56-5.6.6: 100%
```
See, even IT cannot find the file.


----------



## BillFinkNC (Mar 2, 2015)

I believe it finally compiled and put the file in it's proper place!!!

Now what? When I try to start it, here's the error, now?!?!


```
Shared object "libpcre.so.1" not found, required by "httpd"
/usr/local/etc/rc.d/apache24: WARNING: failed to start apache24
```


----------



## junovitch@ (Mar 2, 2015)

That is helpful.  apxs(1)'s man page says is a tool for building and installing Apache extensions.  So the same issue upon installation could have been the cause of the missing module.  `pkg which /usr/local/sbin/apxs` says that file is part of the www/apache24 port.  The library error above is provided by a different package, devel/pcre.

So the real question is why are so many packages messed up if this is a fresh install?  Check everything you can check.  Do a `pkg check -d` for dependencies, `pkg check -B` for shared library issues, and a `pkg check -s` for invalid checksum issues.  If anything gets flagged post it up.


----------



## BillFinkNC (Mar 4, 2015)

I'm not sure what to remove from this reply. (I'm alerted there are too many chars, I tried for 10 minutes removing quite a bit of explaining but will need to break this reply into two sections. )

When I remove packages & properly re-install them, am I doing that properly?

Inside ports www/apache24 and do this: `make rmconfig` then run `make deinstall` I run `make install clean`

`# pkg check -d`

```
Checking all packages: 100%
[root@rmx /usr/ports/www/mod_php56]#
```

`# pkg check -B`

```
Checking all packages:   0%
pkg: (apache24-2.4.12) /usr/local/bin/ab - required shared library libaprutil-1.so.0 not found
pkg: (apache24-2.4.12) /usr/local/bin/ab - required shared library libexpat.so.1 not found
pkg: (apache24-2.4.12) /usr/local/bin/ab - required shared library libiconv.so.2 not found
pkg: (apache24-2.4.12) /usr/local/bin/ab - required shared library libapr-1.so.0 not found
pkg: (apache24-2.4.12) /usr/local/bin/htdbm - required shared library libaprutil-1.so.0 not found
pkg: (apache24-2.4.12) /usr/local/bin/htdbm - required shared library libexpat.so.1 not found
pkg: (apache24-2.4.12) /usr/local/bin/htdbm - required shared library libiconv.so.2 not found
pkg: (apache24-2.4.12) /usr/local/bin/htdbm - required shared library libapr-1.so.0 not found
pkg: (apache24-2.4.12) /usr/local/bin/htdigest - required shared library libaprutil-1.so.0 not found
pkg: (apache24-2.4.12) /usr/local/bin/htdigest - required shared library libexpat.so.1 not found
pkg: (apache24-2.4.12) /usr/local/bin/htdigest - required shared library libiconv.so.2 not found
pkg: (apache24-2.4.12) /usr/local/bin/htdigest - required shared library libapr-1.so.0 not found
pkg: (apache24-2.4.12) /usr/local/bin/htpasswd - required shared library libaprutil-1.so.0 not found
pkg: (apache24-2.4.12) /usr/local/bin/htpasswd - required shared library libexpat.so.1 not found
pkg: (apache24-2.4.12) /usr/local/bin/htpasswd - required shared library libiconv.so.2 not found
pkg: (apache24-2.4.12) /usr/local/bin/htpasswd - required shared library libapr-1.so.0 not found
pkg: (apache24-2.4.12) /usr/local/bin/httxt2dbm - required shared library libaprutil-1.so.0 not found
pkg: (apache24-2.4.12) /usr/local/bin/httxt2dbm - required shared library libexpat.so.1 not found
pkg: (apache24-2.4.12) /usr/local/bin/httxt2dbm - required shared library libiconv.so.2 not found
pkg: (apache24-2.4.12) /usr/local/bin/httxt2dbm - required shared library libapr-1.so.0 not found
pkg: (apache24-2.4.12) /usr/local/bin/logresolve - required shared library libaprutil-1.so.0 not found
pkg: (apache24-2.4.12) /usr/local/bin/logresolve - required shared library libexpat.so.1 not found
pkg: (apache24-2.4.12) /usr/local/bin/logresolve - required shared library libiconv.so.2 not found
pkg: (apache24-2.4.12) /usr/local/bin/logresolve - required shared library libapr-1.so.0 not found
pkg: (apache24-2.4.12) /usr/local/sbin/checkgid - required shared library libaprutil-1.so.0 not found
pkg: (apache24-2.4.12) /usr/local/sbin/checkgid - required shared library libexpat.so.1 not found
pkg: (apache24-2.4.12) /usr/local/sbin/checkgid - required shared library libiconv.so.2 not found
pkg: (apache24-2.4.12) /usr/local/sbin/checkgid - required shared library libapr-1.so.0 not found
pkg: (apache24-2.4.12) /usr/local/sbin/fcgistarter - required shared library libaprutil-1.so.0 not found
pkg: (apache24-2.4.12) /usr/local/sbin/fcgistarter - required shared library libexpat.so.1 not found
pkg: (apache24-2.4.12) /usr/local/sbin/fcgistarter - required shared library libiconv.so.2 not found
pkg: (apache24-2.4.12) /usr/local/sbin/fcgistarter - required shared library libapr-1.so.0 not found
pkg: (apache24-2.4.12) /usr/local/sbin/htcacheclean - required shared library libaprutil-1.so.0 not found
pkg: (apache24-2.4.12) /usr/local/sbin/htcacheclean - required shared library libexpat.so.1 not found
pkg: (apache24-2.4.12) /usr/local/sbin/htcacheclean - required shared library libiconv.so.2 not found
pkg: (apache24-2.4.12) /usr/local/sbin/htcacheclean - required shared library libapr-1.so.0 not found
pkg: (apache24-2.4.12) /usr/local/sbin/httpd - required shared library libpcre.so.1 not found
pkg: (apache24-2.4.12) /usr/local/sbin/httpd - required shared library libaprutil-1.so.0 not found
pkg: (apache24-2.4.12) /usr/local/sbin/httpd - required shared library libexpat.so.1 not found
pkg: (apache24-2.4.12) /usr/local/sbin/httpd - required shared library libiconv.so.2 not found
pkg: (apache24-2.4.12) /usr/local/sbin/httpd - required shared library libapr-1.so.0 not found
pkg: (apache24-2.4.12) /usr/local/sbin/rotatelogs - required shared library libaprutil-1.so.0 not found
pkg: (apache24-2.4.12) /usr/local/sbin/rotatelogs - required shared library libexpat.so.1 not found
pkg: (apache24-2.4.12) /usr/local/sbin/rotatelogs - required shared library libiconv.so.2 not found
pkg: (apache24-2.4.12) /usr/local/sbin/rotatelogs - required shared library libapr-1.so.0 not found
Checking all packages:  60%
pkg: (php56-5.6.6) /usr/local/bin/php - required shared library libpcre.so.1 not found
pkg: (php56-5.6.6) /usr/local/bin/php - required shared library libxml2.so.2 not found
pkg: (php56-5.6.6) /usr/local/bin/php - required shared library libiconv.so.2 not found
pkg: (php56-5.6.6) /usr/local/bin/php-cgi - required shared library libpcre.so.1 not found
pkg: (php56-5.6.6) /usr/local/bin/php-cgi - required shared library libxml2.so.2 not found
pkg: (php56-5.6.6) /usr/local/bin/php-cgi - required shared library libiconv.so.2 not found
pkg: (php56-5.6.6) /usr/local/sbin/php-fpm - required shared library libpcre.so.1 not found
pkg: (php56-5.6.6) /usr/local/sbin/php-fpm - required shared library libxml2.so.2 not found
pkg: (php56-5.6.6) /usr/local/sbin/php-fpm - required shared library libiconv.so.2 not found
Checking all packages: 100%
```


----------



## BillFinkNC (Mar 4, 2015)

junovitch said:


> That is helpful.  apxs(1)'s man page says is a tool for building and installing Apache extensions.  So the same issue upon installation could have been the cause of the missing module.  `pkg which /usr/local/sbin/apxs` says that file is part of the www/apache24 port.  The library error above is provided by a different package, devel/pcre.
> 
> So the real question is why are so many packages messed up if this is a fresh install?  Check everything you can check.  Do a `pkg check -d` for dependencies, `pkg check -B` for shared library issues, and a `pkg check -s` for invalid checksum issues.  If anything gets flagged post it up.



Here is part 2 of my response.

I can tell, this doesn't look good.

I originally used the ports directly from the DVD - then using the newER `portsnap fetch` then `portsnap extract` then finally `portsnap update` . Nothing displayed ANY errors.  All ports SEEMED to be updated just fine. Looking at the output of the commands you requested, I no longer have a fuzzy the ports on my system are proper.

`# pkg check -s`

```
Checking all packages:   0%
apr-1.5.0.1.5.3: checksum mismatch for /usr/local/lib/apr-util-1/apr_crypto_openssl.so
apr-1.5.0.1.5.3: checksum mismatch for /usr/local/lib/apr-util-1/apr_dbd_mysql.so
apr-1.5.0.1.5.3: checksum mismatch for /usr/local/lib/apr-util-1/apr_dbd_sqlite3.so
apr-1.5.0.1.5.3: checksum mismatch for /usr/local/lib/apr-util-1/apr_dbm_db.so
apr-1.5.0.1.5.3: checksum mismatch for /usr/local/lib/apr-util-1/apr_dbm_gdbm.so
apr-1.5.0.1.5.3: checksum mismatch for /usr/local/lib/libapr-1.so
apr-1.5.0.1.5.3: checksum mismatch for /usr/local/lib/libaprutil-1.so
Checking all packages:   4%
autoconf-wrapper-20131203: checksum mismatch for /usr/local/bin/autoconf
autoconf-wrapper-20131203: checksum mismatch for /usr/local/bin/autoheader
autoconf-wrapper-20131203: checksum mismatch for /usr/local/bin/autom4te
autoconf-wrapper-20131203: checksum mismatch for /usr/local/bin/autoreconf
autoconf-wrapper-20131203: checksum mismatch for /usr/local/bin/autoscan
autoconf-wrapper-20131203: checksum mismatch for /usr/local/bin/autoupdate
autoconf-wrapper-20131203: checksum mismatch for /usr/local/bin/ifnames
Checking all packages:  15%
db48-4.8.30.0: checksum mismatch for /usr/local/bin/db_archive-4.8
db48-4.8.30.0: checksum mismatch for /usr/local/bin/db_checkpoint-4.8
db48-4.8.30.0: checksum mismatch for /usr/local/bin/db_deadlock-4.8
db48-4.8.30.0: checksum mismatch for /usr/local/bin/db_dump-4.8
db48-4.8.30.0: checksum mismatch for /usr/local/bin/db_dump185-4.8
db48-4.8.30.0: checksum mismatch for /usr/local/bin/db_hotbackup-4.8
db48-4.8.30.0: checksum mismatch for /usr/local/bin/db_load-4.8
db48-4.8.30.0: checksum mismatch for /usr/local/bin/db_printlog-4.8
db48-4.8.30.0: checksum mismatch for /usr/local/bin/db_recover-4.8
db48-4.8.30.0: checksum mismatch for /usr/local/bin/db_sql-4.8
db48-4.8.30.0: checksum mismatch for /usr/local/bin/db_stat-4.8
db48-4.8.30.0: checksum mismatch for /usr/local/bin/db_upgrade-4.8
db48-4.8.30.0: checksum mismatch for /usr/local/bin/db_verify-4.8
db48-4.8.30.0: checksum mismatch for /usr/local/lib/db48/libdb-4.8.so
db48-4.8.30.0: checksum mismatch for /usr/local/lib/db48/libdb-4.so
db48-4.8.30.0: checksum mismatch for /usr/local/lib/db48/libdb.so
db48-4.8.30.0: checksum mismatch for /usr/local/lib/db48/libdb_cxx-4.8.so
db48-4.8.30.0: checksum mismatch for /usr/local/lib/db48/libdb_cxx-4.so
db48-4.8.30.0: checksum mismatch for /usr/local/lib/db48/libdb_cxx.so
db48-4.8.30.0: checksum mismatch for /usr/local/lib/libdb-4.8.so
db48-4.8.30.0: checksum mismatch for /usr/local/lib/libdb-4.8.so.0
db48-4.8.30.0: checksum mismatch for /usr/local/lib/libdb_cxx-4.8.so
db48-4.8.30.0: checksum mismatch for /usr/local/lib/libdb_cxx-4.8.so.0
Checking all packages:  20%
expat-2.1.0: checksum mismatch for /usr/local/lib/libexpat.so
Checking all packages:  20%
gdbm-1.11: checksum mismatch for /usr/local/lib/libgdbm.so
Checking all packages:  21%
gettext-0.18.3.1: checksum mismatch for /usr/local/lib/libasprintf.so
gettext-0.18.3.1: checksum mismatch for /usr/local/lib/libgettextlib.so
gettext-0.18.3.1: checksum mismatch for /usr/local/lib/libgettextpo.so
gettext-0.18.3.1: checksum mismatch for /usr/local/lib/libgettextsrc.so
gettext-0.18.3.1: checksum mismatch for /usr/local/lib/libintl.so
Checking all packages:  45%
libiconv-1.14_3: checksum mismatch for /usr/local/lib/libcharset.so
libiconv-1.14_3: checksum mismatch for /usr/local/lib/libiconv.so
Checking all packages:  50%
libxml2-2.9.1_1: checksum mismatch for /usr/local/lib/libxml2.so
Checking all packages:  58%
pcre-8.34: checksum mismatch for /usr/local/lib/libpcre.so
pcre-8.34: checksum mismatch for /usr/local/lib/libpcre16.so
pcre-8.34: checksum mismatch for /usr/local/lib/libpcre32.so
pcre-8.34: checksum mismatch for /usr/local/lib/libpcrecpp.so
pcre-8.34: checksum mismatch for /usr/local/lib/libpcreposix.so
pcre-8.34: checksum mismatch for /usr/local/man/man3/pcre16_assign_jit_stack.3.gz
pcre-8.34: checksum mismatch for /usr/local/man/man3/pcre16_compile.3.gz
pcre-8.34: checksum mismatch for /usr/local/man/man3/pcre16_compile2.3.gz
pcre-8.34: checksum mismatch for /usr/local/man/man3/pcre16_config.3.gz
pcre-8.34: checksum mismatch for /usr/local/man/man3/pcre16_copy_named_substring.3.gz
pcre-8.34: checksum mismatch for /usr/local/man/man3/pcre16_copy_substring.3.gz
pcre-8.34: checksum mismatch for /usr/local/man/man3/pcre16_dfa_exec.3.gz
pcre-8.34: checksum mismatch for /usr/local/man/man3/pcre16_exec.3.gz
pcre-8.34: checksum mismatch for /usr/local/man/man3/pcre16_free_study.3.gz
pcre-8.34: checksum mismatch for /usr/local/man/man3/pcre16_free_substring.3.gz
pcre-8.34: checksum mismatch for /usr/local/man/man3/pcre16_free_substring_list.3.gz
pcre-8.34: checksum mismatch for /usr/local/man/man3/pcre16_fullinfo.3.gz
pcre-8.34: checksum mismatch for /usr/local/man/man3/pcre16_get_named_substring.3.gz
pcre-8.34: checksum mismatch for /usr/local/man/man3/pcre16_get_stringnumber.3.gz
pcre-8.34: checksum mismatch for /usr/local/man/man3/pcre16_get_stringtable_entries.3.gz
pcre-8.34: checksum mismatch for /usr/local/man/man3/pcre16_get_substring.3.gz
pcre-8.34: checksum mismatch for /usr/local/man/man3/pcre16_get_substring_list.3.gz
pcre-8.34: checksum mismatch for /usr/local/man/man3/pcre16_jit_exec.3.gz
pcre-8.34: checksum mismatch for /usr/local/man/man3/pcre16_jit_stack_alloc.3.gz
pcre-8.34: checksum mismatch for /usr/local/man/man3/pcre16_jit_stack_free.3.gz
pcre-8.34: checksum mismatch for /usr/local/man/man3/pcre16_maketables.3.gz
pcre-8.34: checksum mismatch for /usr/local/man/man3/pcre16_pattern_to_host_byte_order.3.gz
pcre-8.34: checksum mismatch for /usr/local/man/man3/pcre16_refcount.3.gz
pcre-8.34: checksum mismatch for /usr/local/man/man3/pcre16_study.3.gz
pcre-8.34: checksum mismatch for /usr/local/man/man3/pcre16_utf16_to_host_byte_order.3.gz
pcre-8.34: checksum mismatch for /usr/local/man/man3/pcre16_version.3.gz
pcre-8.34: checksum mismatch for /usr/local/man/man3/pcre32_assign_jit_stack.3.gz
pcre-8.34: checksum mismatch for /usr/local/man/man3/pcre32_compile.3.gz
pcre-8.34: checksum mismatch for /usr/local/man/man3/pcre32_compile2.3.gz
pcre-8.34: checksum mismatch for /usr/local/man/man3/pcre32_config.3.gz
pcre-8.34: checksum mismatch for /usr/local/man/man3/pcre32_copy_named_substring.3.gz
pcre-8.34: checksum mismatch for /usr/local/man/man3/pcre32_copy_substring.3.gz
pcre-8.34: checksum mismatch for /usr/local/man/man3/pcre32_dfa_exec.3.gz
pcre-8.34: checksum mismatch for /usr/local/man/man3/pcre32_exec.3.gz
pcre-8.34: checksum mismatch for /usr/local/man/man3/pcre32_free_study.3.gz
pcre-8.34: checksum mismatch for /usr/local/man/man3/pcre32_free_substring.3.gz
pcre-8.34: checksum mismatch for /usr/local/man/man3/pcre32_free_substring_list.3.gz
pcre-8.34: checksum mismatch for /usr/local/man/man3/pcre32_fullinfo.3.gz
pcre-8.34: checksum mismatch for /usr/local/man/man3/pcre32_get_named_substring.3.gz
pcre-8.34: checksum mismatch for /usr/local/man/man3/pcre32_get_stringnumber.3.gz
pcre-8.34: checksum mismatch for /usr/local/man/man3/pcre32_get_stringtable_entries.3.gz
pcre-8.34: checksum mismatch for /usr/local/man/man3/pcre32_get_substring.3.gz
pcre-8.34: checksum mismatch for /usr/local/man/man3/pcre32_get_substring_list.3.gz
pcre-8.34: checksum mismatch for /usr/local/man/man3/pcre32_jit_exec.3.gz
pcre-8.34: checksum mismatch for /usr/local/man/man3/pcre32_jit_stack_alloc.3.gz
pcre-8.34: checksum mismatch for /usr/local/man/man3/pcre32_jit_stack_free.3.gz
pcre-8.34: checksum mismatch for /usr/local/man/man3/pcre32_maketables.3.gz
pcre-8.34: checksum mismatch for /usr/local/man/man3/pcre32_pattern_to_host_byte_order.3.gz
pcre-8.34: checksum mismatch for /usr/local/man/man3/pcre32_refcount.3.gz
pcre-8.34: checksum mismatch for /usr/local/man/man3/pcre32_study.3.gz
pcre-8.34: checksum mismatch for /usr/local/man/man3/pcre32_utf32_to_host_byte_order.3.gz
pcre-8.34: checksum mismatch for /usr/local/man/man3/pcre32_version.3.gz
Checking all packages:  80%
pkgconf-0.9.5: checksum mismatch for /usr/local/bin/pkg-config
Checking all packages:  86%
sqlite3-3.8.4.1: checksum mismatch for /usr/local/lib/libsqlite3.so
Checking all packages: 100%
```

Feeling woozy, now! Finally and again, I cannot thank you enough for all of the guidance you've given me so far - you've been a great help - (still not installed) but you've shown me some good ways to check specifics.


----------



## BillFinkNC (Mar 4, 2015)

junovitch said:


> That is helpful.  apxs(1)'s man page says is a tool for building and installing Apache extensions.  So the same issue upon installation could have been the cause of the missing module.  `pkg which /usr/local/sbin/apxs` says that file is part of the www/apache24 port.  The library error above is provided by a different package, devel/pcre.
> 
> So the real question is why are so many packages messed up if this is a fresh install?  Check everything you can check.  Do a `pkg check -d` for dependencies, `pkg check -B` for shared library issues, and a `pkg check -s` for invalid checksum issues.  If anything gets flagged post it up.



Here's likely the best question to ask. (I'd rather NOT just reinstall the entire OS, I've some other services running that are critical.)

What is the best way I be certain, (what do I do?) to make my ports "normal" again? (Seems that `portsnap` and extra switches didn't do so well for me by the looks of the output(s).


----------



## kpa (Mar 4, 2015)

BillFinkNC said:


> Here's likely the best question to ask. (I'd rather NOT just reinstall the entire OS, I've some other services running that are critical.)
> 
> What is the best way I be certain, (what do I do?) to make my ports "normal" again? (Seems that `portsnap` and extra switches didn't do so well for me by the looks of the output(s).



Your ports tree at /usr/ports is fine assuming you have just kept updating it with portsnap(8), don't touch it.  Your problems are in the installed packages (some of them were installed by building ports as I have gathered reading this thread) and are most likely a result of mixing the official binary packages with custom built ports. If you don't do the mixing just right you end up with a mess. If you must use ports (for example you must use custom default versions) then the best course of action would be rebuilding everything using ports-mgmt/portmaster, there's a good example in its manual page for doing just that. After you have rebuilt everything you should disable the official packages by editing /etc/pkg/FreeBSD.conf to read enabled: no.


----------



## BillFinkNC (Mar 4, 2015)

kpa said:


> Your ports tree at /usr/ports is fine assuming you have just kept updating it with portsnap(8), don't touch it.  Your problems are in the installed packages (some of them were installed by building ports as I have gathered reading this thread) and are most likely a result of mixing the official binary packages with custom built ports. If you don't do the mixing just right you end up with a mess. If you must use ports (for example you must use custom default versions) then the best course of action would be rebuilding everything using ports-mgmt/portmaster, there's a good example in its manual page for doing just that. After you have rebuilt everything you should disable the official packages by editing /etc/pkg/FreeBSD.conf to read enabled: no.




I'll be the very first to admit this, I have NO IDEA what I did to change things, but Apache24 that came with 9.3 and PHP56 are now working fine. I cannot tell you how many different places I had to go into to run `make`, but just 2 minutes ago PHP compiled and so did Apache, (without errors) and it installed/loaded libphp5.so module just fine! I've been reading SO many answers to so many questions - one of 'em must've done the right thing to make it compile without a complaint.

You're really very kind in all the  help you've shared - thank you, very much, thank you!


----------



## junovitch@ (Mar 5, 2015)

Whatever the cause, all the `pkg check` commands should all run cleanly.  Have you used ports for everything on the system?  Mainly the biggest gotcha is the ports tree is only supported as a whole.  Selectively choosing what to upgrade is best left to when you understand what's going on behind the scenes.  And since packages are a couple days behind ports there might be minor issues with dependencies because of changes in the ports tree.

Depending on how much your "I've some other services running that are critical" concerns you, you may want to consider either sticking with packages either from the public repo or via a local ports-mgmt/poudriere setup as described in the FreeBSD Handbook at https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ports-poudriere.html.  Having that split where you can compile and test outside of a production environment can be helpful to keeping availability up.


----------

