Making SQLAnywhere PHP module for PHP-5.2

There was a previous post here about the available pre-built downloads of
the Sybase SQLAnywhere PHP module not working with PHP-5.2 due to the PHP
API version stamp. So I built it myself. Instructions are below. I have not
tested the result much yet, but it does seem to work well.

This is how to build the SQLAnywhere PHP module stand-alone - that is,
without rebuilding PHP. The method is described in the PHP source release
document README.SELF-CONTAINED-EXTENSIONS. You need a working PHP
installation, but you do not need the PHP source tree to build this.

My environment is Linux, Apache 1.3.x, PHP-5.2.0, SQLAnywhere 9.0.x.y.
You need to install the SQLAnywhere "C++ Development Tools" package, which
contains the sqlpp pre-processor. You need to download the module source
sqlanywhere-1.0.8.tar.gz. You also need to apply one patch to this source.
I don't know why this ever compiled without the patch.

The following assumes PHP lives in /opt/php, and Sybase SQLAnywhere in
/opt/sybase (and your SYBASE environment variable is set, and PATH
includes its bin directory). Adjust to your paths as needed.

1. Unpack and patch the source.
$ tar -xvzf sqlanywhere-1.0.8.tar.gz 
$ cd sqlanywhere
Apply this patch, manually or using the 'patch' command:
=============
--- sqlany_imp.sqc.orig	2007-01-26 13:56:53.000000000 -0500
+++ sqlany_imp.sqc	2007-01-26 13:58:02.000000000 -0500
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include <sys/types.h>
 #include <assert.h>
=============

2. Prepare the source for self-contained extension building:
$ /opt/php/bin/phpize

3. Configure:
$ ./configure --with-php-config=/opt/php/bin/php-config \
    --with-sqlanywhere=shared,/opt/sybase

4. Build:
$ make

If it builds OK, you can now copy the file modules/sqlanywhere.so into
your PHP loadable extensions directory and load it as needed.
0
ljb
2/2/2007 1:43:28 AM
sybase.sqlanywhere.linux 1065 articles. 0 followers. Follow

1 Replies
855 Views

Similar Articles

[PageSpeed] 28

ljb wrote:
> There was a previous post here about the available pre-built downloads of
> the Sybase SQLAnywhere PHP module not working with PHP-5.2 due to the PHP
> API version stamp. So I built it myself. Instructions are below. I have not
> tested the result much yet, but it does seem to work well.
> 

Thanks!  In the past, I have compiled the module by rebuilding php, and 
your method is so much easier.  Since I was just getting ready to update 
the module to 5.2, you saved me sooooooooooooo much time.

Again, a big thanks.

0
baf
2/2/2007 6:14:27 AM
Reply:

Similar Artilces:

sqlanywhere module for PHP 5.1.2?
Hello, I am experiencing problems, when trying to compile sqlanywhere module with PHP 5.1.2. At first I copy 1.0.8 version to PHP source "ext" dir. Then I cd sqlanywhere and touch * then cd to PHP source dir and ./buildconf --force then ./configure --with-apxs ... --with-sqlanywhere=/opt/sybase/SYBSsa9 and configure script gives me: configure:111881: checking for SQLAnywhere support configure:111920: result: no So this PHP version is not supported yet? When it is planned to be supported? Thank you. Arunas Altair <altair@pagalba.com> wrote in news:43cec...

Using the SQLAnywhere 9.0.2 PHP module
Hi, Using the SQLAnywhere 9.0.2 and PHP(5.0.2) module I would like to set AUTO_COMMIT to OFF. I tried with sqlanywhere.auto_commit=0 in php.ini file and $result = sqlanywhere_set_option( $conn, "AUTO_COMMIT", "OFF" ); but the result is the same, could not set AUTO_COMMIT OFF This is the sample <?php # Connect using the default userid and password echo "<pre>"; $conn=0; $conn = sqlanywhere_connect( "eng=office;dbn=work;uid=DBA;pwd=SQL;links=tcpip" ); if($conn==0) { echo "Connection failed\n"; return 0; ...

sqlanywhere php module
I am trying to compile the php module as extension module to make it fit into debian. I am using a 7.0.4 ASA. Here is what I did: 1) grap a copy sqlanywhere-1.0.1 and extract it into the ext dir of the php source distribution. 2) called "phpize" inside the sqlanywhere directory to create all necessary build stuff 3) called "make all" which builds the sqlanywhere.so in the modules directory 4) switched to root and called "make install" to make it available to php 5) added the line "extension=sqlanywhere.so" to the php.ini 6) resta...

sqlanywhere php module
I am trying to compile the php module as extension module to make it fit into debian. I am using a 7.0.4 ASA. Here is what I did: 1) grap a copy sqlanywhere-1.0.1 and extract it into the ext dir of the php source distribution. 2) called "phpize" inside the sqlanywhere directory to create all necessary build stuff 3) called "make all" which builds the sqlanywhere.so in the modules directory 4) switched to root and called "make install" to make it available to php 5) added the line "extension=sqlanywhere.so" to the php.ini 6) resta...

PHP5 and SQLAnywhere PHP module
Anyone tried compiling the php module into the release candidate of PHP5? Is there any reason to believe that it will (or will not) be easy to use the module in PHP5? Thanks Guess I am the only interested soul in this question. For anyone that might later stumble on this question, I tried the SQLAnywhere php module with PHP5 RC2 and it worked fine. baf wrote: > Anyone tried compiling the php module into the release candidate of > PHP5? Is there any reason to believe that it will (or will not) be easy > to use the module in PHP5? > > Thanks > ...

sqlanywhere php module timeout?
Howdy, I'm running the sqlanywhere 1.0.6 php module on apache 1.3.31. It works great, except when I hit nasty long queries. The queries all run fine from a remote client, but on the web server, anything more than about 20 seconds will hang until apache is restarted. I have raised all of the timeouts in the httpd.conf and php.ini files, but none of them seem to have any effect on them. Is there a variable specific to the sqlanywhere module that I can specify the timeout in the php.ini(or elsewhere) file? Thanks. Tom SqlAnywhere 9.0.1 on Redhat AS 2.1 There is no spec...

sqlanywhere php module errors
There are a lot of bugs in thos module: I compiled it (with little problems) witch PHP 4.2.1 and Apache 1.3.24 on Lunix Debian (kernel 2.2.19) I got this error when using sqlanywhere_fetch_row( ..) and sometimes serveral times on one page: Warning: String is not zero-terminated (02-07-02) (source: ../zend_execute.c:1778) in /var/www/hoth/cm/browse.php on line 29 Seems that fetch row returns string not corectly terminated when i try to compare two strings (one form variable and one returned by sqlanywhere module) php says they are not same but they seems to be same). Othe...

PHP php-5.0.4_sqlanywhere9.dll module
Hi! I'm using SQLAnywhere PHP module (9.0.2) on Windows, IIS web server and I'm experiencing two problems. First thing is I'd like to use persistent connections (sqlanywhere_pconnect function). The problem is that after a sequence of sqlanywhere_pconnect executions I notice many opened connections. Isn't it suppose to reuse the established connection, if the connection strings match!? The second things is fetching records empty records ''. The php functions (sqlanywhere_fetch_object, sqlanywhere_fetch_row) return a chr(32) - space: ' ' instead ...

SQLAnywhere php module error on connect
After successfully getting the php module working on one machine, I tried installing the module on another with the same operating system (SUSE9). After completing the installation, I tried testing the setup by connecting to the asademo database. I immediately get warning error number -740 and the connection fails. The database server is running and the database is available (tested with scjview). Any way to find out what that error number might mean? Thanks baf <who@where.com> wrote in news:402c8ccb@forums-2-dub: b> After successfully getting the php module w...

PHP -SqlAnywhere
I receive the following error when running the test connection script used in the PHP-ASA White paper. Warning: SQLAnywhere: [-740] unknown error 2385 in /www/asa_test.php on line 2 Can someone tell me what this error is. Thanks Can you please provide the versions of Apache, PHP, ASA (server), and ASA(client) that you are using. Have you sourced the configuration file asa_config.sh before starting Apache? M. Abouzour Barry_Barker wrote: > > I receive the following error when running the test connection script used > in the PHP-ASA White paper. > &...

sqlanywhere module for 64 bit php
Has anyone build sqlanywhere.so for using as php module for 64-bit php 4.4 or can someone send me manual , how to make it. Thanks David ...

sqlanywhere 5.5 #2
Please don't laugh but I need to find a copy of sqlanywhere 5.5.0.4 preferrably. I have a friend that I am helping with his office database and he can't find his disk. Does anyone know where I might get one, if they are available. Thanks. Later versions of SQL Anywhere can open V5.5 database files, up to version 9. With Version 10 and later you need to run dbunload to migrate the file, but you still don't need V5.5 software for that. Breck On 5 Nov 2008 20:11:07 -0800, Tim Brown wrote: >Please don't laugh but I need to find a copy of sqlanywhere >5.5.0...

SQLAnywhere PHP Module interface reference
Hi, using ASA 9.0.2.3137 and PHP 4.3.10 This is a simple test of sqlanywhere_query $result = sqlanywhere_query( $conn, $qname ); if( ! $result ) { echo "sqlanywhere_query failed!"; } else { sqlanywhere_result_all( $result, "border=1" ); sqlanywhere_free_result( $result ); } sqlanywhere_query returns 7 when $qname is : alter PROCEDURE "DBA"."my_test"() begin select * from dba.my_test; end; BUT!! sqlanywhere_query returns 0 when $qname is : if exists(select 1 from sys.sysprocedure where proc_name='my_test')...

PHP SQLAnywhere module: Affected Rows
I'm considering switching from the PHP sybase_ct module with FreeTDS to the PHP-SQLAnywhere module. First problem I ran into: There seems to be no way to get the number of affected rows after sqlanywhere_execute(). (Like: sybase_affected_rows(), mysql_affected_rows(), pg_affected_rows() etc.) From the source code, it looks like if I use sqlanywhere_query() instead of sqlanywhere_execute(), and it gets no result set back, it puts the affected row count where sqlanywhere_num_rows() will find it. So maybe that's how to do it, but it seems like an undocumented trick. Is this the...

Web resources about - Making SQLAnywhere PHP module for PHP-5.2 - sybase.sqlanywhere.linux

IBM Tivoli Storage Manager - Wikipedia, the free encyclopedia
IBM Tivoli Storage Manager ( TSM or ITSM ) is a centralized, policy-based, enterprise class, data backup and recovery package. The software enables ...

Archives - Caelum's Blog
Caelum's Blog Random Stuff Navigation Home - Articles Tags 256colors 64 64bit 8 activeperl activestate advent ajax alsa amd64 asa asus automation ...

keynote bingo - Google Search
Search Images Maps Play YouTube News Gmail Drive More Calendar Translate Mobile Books Wallet Shopping Blogger Finance Photos Videos Even more ...

Mobile and Wireless Partners - Partners - Sybase Inc
Thanks for visiting the Partners section of Sybase.com. Here you will find information about Mobile and Wireless Partners - Partners. For more ...

Datensynchronisierung - sqlanywhere
„Good Partner - quick and reliable answers! Fast "delivery" by Email. Everybody can count on them." Tímea Steigervald, Product Manager Kvazar-Micro ...

Browse file extension list beginning with letter A
Browse file extension list beginning with letter A - File-Extensions.org search page

OpenLink ODBC Adapter for Ruby on Rails: OpenLink ODBC Adapter for Ruby on Rails: Downloads
OpenLink ODBC Adapter for Ruby on Rails: OpenLink ODBC Adapter for Ruby on Rails: Downloads

Developer Edition - sqlanywhere
„Good Partner - quick and reliable answers! Fast "delivery" by Email. Everybody can count on them." Tímea Steigervald, Product Manager Kvazar-Micro ...

IBM - sqlanywhere
„Good Partner - quick and reliable answers! Fast "delivery" by Email. Everybody can count on them." Tímea Steigervald, Product Manager Kvazar-Micro ...

Datenaustausch - sqlanywhere
„Good Partner - quick and reliable answers! Fast "delivery" by Email. Everybody can count on them." Tímea Steigervald, Product Manager Kvazar-Micro ...

Resources last updated: 12/6/2015 8:27:12 AM