Operating System - Linux
1752533 Members
5126 Online
108788 Solutions
New Discussion юеВ

Re: Is there a HP-UX PHP distro with copiled-in MySQL support?

 
SOLVED
Go to solution
Ralph Grothe
Honored Contributor

Is there a HP-UX PHP distro with copiled-in MySQL support?

Hello,

due to a server swap I needed to move our little HP-UX/Apache/PHP/MySQL evolution roster (instead of LAMP I'd call it HAMPER ;-) tool which was accompanied with a reinstallation of HP's Apache suite on the new server.

I happened to have snatched this HP Apache release.


# swlist |grep -i apache
hpuxwsApache A.2.0.55.00 HP-UX Apache-based Web Server

# /opt/hpws/apache/bin/httpd -l
Compiled in modules:
core.c
worker.c
http_core.c
mod_so.c

# ll /opt/hpws/apache/modules/*php*
-rwxr-xr-x 1 bin bin 9339684 Nov 3 10:25 /opt/hpws/apache/modules/libphp5.so


When I invoke any URI of our tool now I get this.

Fatal error: Call to undefined function mysql_connect() in /opt/hpws/apache/htdocs/sv/config.inc.php on line 2


As it seems the PHP bundled with this particular HP Apache suite doesn't seem to have compiled in support for MySQL (the backend of our tool)


# find /opt -type f -name php
/opt/depot/hpuxws/hpuxwsAPACHE/PHP2/opt/hpws/apache/php/bin/php
/opt/hpws/apache/php/bin/php

# /opt/hpws/apache/php/bin/php -v
PHP 5.0.4 (cli) (built: Oct 24 2005 14:31:44)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.0.4-dev, Copyright (c) 1998-2004 Zend Technologies

# /opt/hpws/apache/php/bin/php -m
[PHP Modules]
ctype
dom
iconv
libxml
pcre
posix
session
SimpleXML
SPL
SQLite
standard
tokenizer
xml

[Zend Modules]

Nice that they compiled for SQLite support
but I'd rather like to stick to our MySQL backend (too much fuss getting into yet another database and ex- and importing)

Actually, I wonder if they missed the MySQL support deliberately for any license issues?
On the other hand the MySQL that I installed is a HP bundle as well.


# swlist|grep -i mysql
ixMySQL A.06.00-4.1.15 MySQL Database


Before I now delve into downloading the mod_php interpreter sources and building a MySQL aware binary I would like to check if there isn't a ready made bundle available from HP.

Rgds
Ralph
Madness, thy name is system administration
8 REPLIES 8
Hemmetter
Esteemed Contributor
Solution

Re: Is there a HP-UX PHP distro with copiled-in MySQL support?

Hi Ralph,

Mysql-support should be already compiled in.

Do you have the line "extension=mysql.sl"
in your php.ini?

And a mysql.sl file in your php/extensions directory?

Check if your software references "mysql.so", but HP-UX has a "mysql.sl".

rgds
HGH
Ralph Grothe
Honored Contributor

Re: Is there a HP-UX PHP distro with copiled-in MySQL support?

Meanwhile I downloaded the IPv6 capable depot for HP-UX 11.11 PARISC, and it looks that they have furnished this depot with mysql support.

# swlist -l file -s /tmp/HPUXWSATW-B215-1111.depot hpuxwsAPACHE.PHP\*|grep -i mysql
hpuxwsAPACHE.PHP: /opt/hpws/apache/php/lib/php/DB/mysql.php
hpuxwsAPACHE.PHP2: /opt/hpws/apache/php/lib/php/extensions/mysql.sl


But wait, these libs are also in my installed depot

# swlist -l file hpuxwsApache|grep -i mysql
hpuxwsApache.hpuxwsAPACHE.PHP: /opt/hpws/apache/php/lib/php/DB/mysql.php
hpuxwsApache.hpuxwsAPACHE.PHP2: /opt/hpws/apache/php/lib/php/extensions/mysql.sl

So have I missed something, like registering these libs in httpd.conf?
But there's no even commented reference to them in it.

# ll /opt/hpws/apache/php/lib/php/DB/mysql.php
-rw-r--r-- 1 bin bin 32295 Nov 3 10:28 /opt/hpws/apache/php/lib/php/DB/mysql.php

# grep -ci mysql /opt/hpws/apache/conf/httpd.conf
0


I'm not into PHP.
Is there a global config file or so where I could include the path to those mysql libs?



Madness, thy name is system administration
Ralph Grothe
Honored Contributor

Re: Is there a HP-UX PHP distro with copiled-in MySQL support?

Hello Hemmeter,

I found a php.ini
But I can't remember to have tinkered with that file on my previous install where things worked.
Yes, you are right.
Looks like a comment prepending the extension=mysql.sl line.
Do you know what else I would need to set here (apart from removing the semicolon)?

# grep -i mysql /opt/hpws/apache/conf/php.ini
;extension=mysql.sl
[MySQL]
mysql.allow_persistent = On
mysql.max_persistent = -1
mysql.max_links = -1
; Default port number for mysql_connect(). If unset, mysql_connect() will use
; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
; compile-time value defined MYSQL_PORT (in that order). Win32 will only look
; at MYSQL_PORT.
mysql.default_port =
; Default socket name for local MySQL connects. If empty, uses the built-in
; MySQL defaults.
mysql.default_socket =
; Default host for mysql_connect() (doesn't apply in safe mode).
mysql.default_host =
; Default user for mysql_connect() (doesn't apply in safe mode).
mysql.default_user =
; Default password for mysql_connect() (doesn't apply in safe mode).
; *Any* user with PHP access can run 'echo get_cfg_var("mysql.default_password")
mysql.default_password =
mysql.connect_timeout = 60
mysql.trace_mode = Off
[MySQLI]
mysqli.max_links = -1
; Default port number for mysqli_connect(). If unset, mysqli_connect() will use
; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
; compile-time value defined MYSQL_PORT (in that order). Win32 will only look
; at MYSQL_PORT.
mysqli.default_port = 3306
; Default socket name for local MySQL connects. If empty, uses the built-in
; MySQL defaults.
mysqli.default_socket =
; Default host for mysql_connect() (doesn't apply in safe mode).
mysqli.default_host =
; Default user for mysql_connect() (doesn't apply in safe mode).
mysqli.default_user =
; Default password for mysqli_connect() (doesn't apply in safe mode).
; *Any* user with PHP access can run 'echo get_cfg_var("mysqli.default_password")
mysqli.default_password =
mysqli.reconnect = Off
Madness, thy name is system administration
Hemmetter
Esteemed Contributor

Re: Is there a HP-UX PHP distro with copiled-in MySQL support?

Hi again Ralph

Did you check your
/opt/hpws/apache/conf/php.ini

for that "extension=mysql.sl" line?


Whats in your config.inc.php on/around line 2 where the fatal error occurs?

HGH
Steven E. Protter
Exalted Contributor

Re: Is there a HP-UX PHP distro with copiled-in MySQL support?

Shalom Ralph,

I think one of the other hpws distributions has this support.

mysql is an open source database, there are no license or use issues at all.

I know that the hpws 2.13 rlease has Mysql 5.x and php 5.x

If this is not good for your project then one of the other hpws releases should do it.

Frankly, it seems to be a rather glariing error. I didn't have to change this at all on my Linux machines.

My mysql/php combos on my play hp-9000 machines at home is out of date, but I'll look at it. I believe that there should be no configuration change to support php/mysql data read/write/update.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Ralph Grothe
Honored Contributor

Re: Is there a HP-UX PHP distro with copiled-in MySQL support?

Uncommenting the extension=mysql.sl
did the trick.

# grep extension=mysql /opt/hpws/apache/conf/php.ini
extension=mysql.sl

Now the PHP interpreter can connect to the MySQL backend, and I don't get the driver's fatal error anymore.

Now I'm struggling with implementation details of our tool.
Though I still cannot login to our server roster I know that at least the PHP stuff gets executed.
I'll have to ask the person that wrote the tool tomorrow for the rest.



Madness, thy name is system administration
Arunvijai_4
Honored Contributor

Re: Is there a HP-UX PHP distro with copiled-in MySQL support?

Hi Ralph,

Which version of PHP you are using ? HP ended support for PHP4 on or after Dec 31'05. You may have to download the latest version of HP-UX Webserver suite.

http://h20293.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=HPUXWSARCHIVE

It comes with PHP5.

Main Site,
http://h20293.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=HPUXWSSUITE

http://h20293.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=HPUXWSATW215

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"

Re: Is there a HP-UX PHP distro with copiled-in MySQL support?

Here is what I have determined.

The current 64-bit version compiled for 11.23 was not compiled with mysql support. I could only find reference to it after the install, finding out it didn't work, and then looking at the online documentation that they provide with the package.

Interestingly; while they are telling you in the documentation that they didn't compile the 64-bit with mysql support, they mention that it is compiled in the 32-bit version.

Now with the 32-bit version for 11.23, you get php 5.0.4 and apache 2.0.55. It does work with the ixMySQL A.06.00-4.1.15 MySQL Database that you have installed. This seems to be as close as I can get with the current HP offering.

So I am still left with the puzzling question as to why they choose not to compile the 64-bit with mysql support. Why is the php5 version as old as it is? Current version is like 5.1.2? The packages come with gd.sl but not gd2.sl which almost everyone putting out graphing wrappers needs with php5?

So do I understand correctly, that this compiling omission isn't in the 11.11 version of the package?

Using software packages downloaded from the net leads to a terrible amount of effort to get them working. Some don't mind using HP ANSI C compiler and others don't. And those seem to work fine with gcc. I would much rather have HP depot packages as I need to apply this to over 60 servers. Even if I had HP's source code, I doubt that I could pull it together to give me the exact packaging the HP is supplying with just mySQL support for the 11.23 64-bit.

I've been at an impasse on this for a while now.