php sybase install on mac - php

I have installed the entire lamp stack with homebrew on my macbook pro. I am in need of getting the sybase module installed but am having the worst time trying to figure it out. I have done upteen google searches and read over the php.net section on sybase:
http://php.net/manual/en/sybase.installation.php
I have no clue when it says:
To enable Sybase-CT support configure PHP --with-sybase-ct[=DIR]
I was hoping to reach out to someone who has enabled/installed this on a mac or unix environment. Hope you can let me know the steps I need to run to get this up and running so I can use:
sybase_connect();
Thanks in advance.

You can also use FreeTDS to connect to Sybase from your Mac's PHP. Will be much easier than trying to configure the Sybase-CT library.

That section is asking for where on your system the Sybase installation is. To connect to a Sybase DB, you need to have either the client piece, SDK, or server piece installed on the local system.
The Sybase home directory includes the connection libraries that PHP is looking for.

Related

Laravel 4 on Mac localhost: Cannot find driver for SQLSRV

I'm trying to connect with Laravel 4 to an SQL Server database. I'm getting an error, but I think it's a PHP error, not a Laravel error. It says PDOException: could not find driver. I have the driver set to sqlsrv like another example in the database.php file. Like I said, I think this is a PHP error, not Laravel.
I'm on localhost on my Mac. Do I need to configure something in my php.ini file? I found another article that said I need to comment out a MySQL driver under PDO. I also couldn't find that line in my php.ini. But I need to connect to a MySQL database as well, anyway. What do I need to change in my php.ini file?
I found this line:
pdo_mysql.cache_size = 2000
But commenting it out did nothing even after restarting Apache.
The sqlsrv driver is a windows-only driver according to the PHP Manual (www.php.net/manual/en/sqlsrv.requirements.php). So you can't use that driver on Mac, Linux, Unix or any other operating system than the ones listed on that page.
I assume you are trying to connect to a remote SQL Server somewhere? If you're on Mac, then SQL Server wouldn't be running on your local machine, so I guess the first question is whether or not you have a SQL Server running somewhere.
Second, from the server that is running PHP, you would need to connect using either FreeTDS or ODBC with FreeTDS.
Since Laravel 4 uses PDO, you'll need to install FreeTDS and ODBC. Laravel 4 doesn't use the mssql PHP extension. It uses PDO, so mssql won't get you anywhere with Laravel 4.
If you're serving PHP from your Mac, I would say there are generally 4 different ways you could go:
The Easy, but costly way: Go to (www.macupdate.com/app/mac/23152/openlink-odbc-driver-for-sybase) and download and install OpenLink ODBC driver. This allows you to create new ODBC connections using the Sybase (MSSQL) driver on a XNIX machine. There's an installation walk-through here (wikis.openlinksw.com/dataspace/owiki/wiki/UdaWikiWeb/InstallSybaseExpressOSX). It comes with a 15 day trial, after which you would have to purchase it. As of this writing, it appears to cost somewhere in the range of $30 - $50 depending on the license you choose.
The harder, but free way: Follow http://blog.benjaminwalters.net/?p=10 (slightly outdated) to re-compile FreeTDS support into PHP on Mac (assuming you're using MAMP)
The far better, but also far more work way: Find a Virtual Machine Host software like VMWare Fusion and install a Linux server like Ubuntu 12.4. Make sure you install apache2 and PHP during the install process and then follow the steps here to get FreeTDS working on your new server machine.
Run PHP from the Windows Server that is running SQL Server
Milage will vary with each solution, and there is a learning curve in any case. I've been a PHP developer for a long time, and it took me days to figure out how to get connected to SQL Server for the first time from Linux. Thankfully, there are quite a few walkthroughs out there now, and FreeTDS has come a long way since that time.
Hope that helps. :)
I actually have this running on my setup. My best advice is to get on the Homebrew bus.
https://github.com/josegonzalez/homebrew-php is where you're going to want to look for installing PHP and related items. I don't remember exactly what I did but it wasn't particularly difficult.
First you'll need FreeTDS.
brew install freetds
Then, add Jose's formulas to your homebrew (instructions on the github page). After that,
brew install php5x --with-mssql
brew options php5x
if you need more extensions.
Based on Jon Watson's comment,
I've tried step 2, and it doesn't work. check my issue here https://github.com/laravel/laravel/issues/2180
Step 3 is broken link and I think it's the same with step 2.
I also tried linux ODBC driver for Laravel (there are 2, google it), both doesn't work too. Although my simple test php works in both DBLIB and ODBC (compiled using official microsoft odbc unix driver).
Step 4 definitely works, BUT you must use IIS for best stability.
That leaves step 1. OR,
Ditch Laravel4 and use good ol' AdoDB http://adodb.sourceforge.net/ which I've been using since 2006 and still working superbly (although not modern like Laravel) configure it using tutorial in http://docs.moodle.org/20/en/Installing_MSSQL_for_PHP
I wonder why they don't build sqlsrv driver for linux too....

PHP can't connect with Oracle Database

I have installed Vertrigo Server with [Apache 2.0] & [PHP 5.2.14] on Windows XP X32 but Vertrigo server doesn't includes OCI8.DLL extension for Oracle Database. When I tried to copy this DLL file from another version of PHP I got Apache error:
[v_apache.exe]: The application cannot start because php5.dll is
missing.
Without this DLL file everything is wokrking OK, but I need to connect with oracle Database. Have you any solutions how to add OCI8.DLL extension in that version of PHP and Apache?
Thanks.
Simpliest way is to use Zend Server CE.
It has latest stable apache with latest stable PHP stack, also with oci libraries (and much more).
Download for free (registration required).
After long time searching over the internet finaly I found soltion for it. Strange is that Apache doesn't alert error about real problem, it just says that problem is with 80 port, even when 80 port is free.
Solution is very simle: I just installed Microsoft Visual C++ 2010 Redistributable Package and after averithing was running correctly.

PHP DB2 DLL for PHP 5.3.8

Where can i get the php 5.3.8 dll extension to enable connection to a DB2 database. I tried searching the net and was unable to find any download links. :(
regards,
V
You can find many of this info here
http://sourceforge.net/projects/db2mc/files/
I tried download dlls from various sources but at the end XAMPP was the solution. If you install this application server download from XAMPP home page.
This contains the a php and within a php.ini and the right dlls - so it worked for me.
If you are trying to connect to zOS or iSeries systems then you might face licensing issues too..

PHP MS SQL Unix Driver - Microsoft or FreeTDS

I am running a LAMP server but now need to connect to MS SQL (client request). I have heard Microsoft has a driver, but can't verify if
Does anyone know if the Microsoft driver is available for Unix? If not, should I just stick with FreeTDS? This appears to be recommended by PHP, however install documentation seems lacking. Any direction on either would be greatly appreciated.
Sorry for the general question, I am not familiar with setting up PHP drivers.
UPDATE
Just for some back story, I am running an intranet from the LAMP server but needs to connect to a datasource on an external MS SQL DB Server (Windows of course). I am running PHP5.
FreeTDS is fine and works well enough. The Microsoft driver is Windows only, thus you wouldn't be able to use it on your Linux server.
First install FreeTDS and then configure PHP with --with-mssql=/prefix/used/for/freetds. If you are using your distribution's PHP, I'm sure there is a MS-SQL driver package already precompiled and available for installation (in Ubuntu, that'd be php5-sybase).
Then use PHP's mssql_* functions to actually do the work
For anyone who comes across this rather old question...
It should be noted that since 2010, Microsoft has actually developed a viable Linux driver for SQL Server that is installable via PECL. It's currently only compatible with PHP 7.
The main readme file is here, which lists some general and overly complicated installation instructions. But if you look at the latest release notes you will see that newer versions can be installed via PECL like so:
sudo pecl install sqlsrv
sudo pecl install pdo_sqlsrv

Getting familiar with XAMPP

Iam not able to get familiar with XAMPP interface on Windows7 (Only prior experiencxe is with HTML,C,C++).
How to proceed to begin development work in PHP and MySQL and test developed contents using Apache Server.
Please help to understand its working flow.
Thanks in Advance.
First, find a good PHP book or tutorial to learn PHP. There are plenty out there, just Google or visit the PHP homepage.
As you follow the book or tutorial, save your .php files in the XAMPP htdocs folder. This will let you view your results using the XAMPP web server. For example, if you write a PHP script called test.php and save it in the htdocs folder, you can access it on your local XAMPP server via http://localhost/test.php.
XAMPP includes phpMyAdmin, which lets you manage the included MySQL database. You can learn more about phpMyAdmin here.
Be sure to read the XAMPP documentation so that you know how to start up Apache and MySQL and access phpMyAdmin.
XAMPP is only a service that provides a webserver, server side language (PHP), database and interface to connect to said interface. Once it is installed you are good to go, all you need to do is turn on Apache, then MySQL. All the rest of the installation requirements should be done automatically upon installation.
Maybe it is better to explain your particular issue...
I was beginning from Denwer. It was very easy to begin with him. He includes php, mysql, apache.
http://www.denwer.ru
You have to run the Apache server for php and the MySQL server for MySQL :D. You can run it by starting the XAMPP Control and than run them. Now you can go to the localhost http://localhost/
There are some instructions.
I hope it is useful.
Marcel
Do you really need XAMPP? Sumit, I also have Win7/x64 on one machine, where I installed
Apache 2.2.16 for 32bit Windows
PHP 5.3.2 (x32 Windows VC6 install binary)
Perl 5.12.1 32bit x86 from Activestate
MySQL 5.1 32bit x86 Windows installer)
I installed all-32-bit stuff (even if on 64bit Windows) because that guarantees you a much simpler life. You can handle or maintain every component individually, for including PHP or Perl into Apache, you just change a line or two in the Apache config file. There's no magic at all with all these programs. Install them by yourself and learn a lot in the process.

Categories