XAMPP PDO Oracle, Cant make it work together - php

i want to make connection of PDO to oracle database.
i tried all day to set it up, i am using xampp, installed latest version of xampp.
i tried to follow this guide: Installing PHP and the Oracle Instant Client for Linux and Windows
Also have tried to follow this guide: Activate Oracle on XAMPP for Windows : OCI8
Please anyone help me guide me to the right direction. I am stucked and it is a must to do job, cuz all my work relies on it.
the server i want to deploy my file, runs on oracle database, thats why i want to tryout the oracle in my local PC.

Related

Host PHP application on IIS and then DB driver error

I have a PHP application that is already hosted on Windows IIS Server.But when i try to run it now then it shows me the error."db driver not found".BUT i have installed Microsoft Drivers 5.6 for PHP for SQL Server .But still getting error.I'm using SQL Server Express 14.0.1000.169 version.
Is this a correct driver version to download ? or what is the error?.
firstly, are you sure you chose the correct dll for your computer to be the php extension? version, thread safety, system architecture. All of these matter. If that is correct then you can move on to the next step which are drivers.

How to run Glassfish server with wamp?

I am running a NetBeans project on my Windows machine with Glassfish server with MySQL server 5.6. Now I installed wamp 3.1.3 (64bit), but MySQL service is not starting in wamp. I know it is because MySQL is already running on port 3306. I have tried to change port number for MySQL of wamp in my.ini and php.ini files, but this doesn't work for me.
I have tried so many ways to solve this but didn't succeed. Kindly guide me to solve this issue.
I have found a simple solution of my problem. The sequences of the steps has given below.
Backup your data from C:\MySQL\MySQL Server 5.6\data or export your database by using MySQL Workbench
Remove already installed MySQL Server, using MySQL community installer
Now restart wampmanager.exe
import your data into MySQL database
Cheers. It will work smoothly.

php sybase install on mac

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.

Proper setup of Oracle Environment variables for PHP, MDB2, and OCI8

I've set up a Fedora 19 server, with Oracle 11g, PHP 5.5.4, Apache 2.4.6, and PEAR 1.9.4. In addition to this, I have the OCI8 plug-in for PHP downloaded and enabled, and have downloaded MDB2 and the MDB2_Driver_oci8.
However, there are problems with the setup - an old website from an older server doesn't work on it, so it seems the culprit is an improperly setup Oracle environment for Apache, and oci8.
The Oracle 11g Database itself, however, works fine - I've been able to log in as SYSTEM, create a new user, and restore a database to said user.
Below is a screenshot from the Environment of the new Fedora 19 server, using phpinfo():
Below is a screenshot of the Environment of the older Fedora server:
There's a lot, but probably the only important things there are the ones concerning Oracle.
I followed link here tutorial on how to install Oracle 11g on Fedora, and I was able to get it up and running, albeit I have to run . /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh every time I start up.
But whereas in the old server, it shows up in the Environment (in phpinfo()), in the new server, it does not.
Of note is that LD_LIBRARY_PATH is set in both, but I had to to add it manually in the httpd file (/etc/sysconfig/) by adding the following in it:
LD_LIBRARY_PATH="/u01/apps/oracle/product/11.2.0/xe/lib export
LD_LIBRARY_PATH
But if I echo out LD_LIBRARY_PATH in the newer server, it returns nothing. In the older server, it returns what is displayed in the Environment page.
What's going on here? How do I fix this? And is there any other Oracle-related thing I missed?
Thanks to any and all who will help.

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....

Categories