macOS Ventura (Apple Silicon M2) + XAMPP + PDO SQL SERVER: PDO Exception - Could not find driver - pdo

I hope you guys are doing well.
I used for many years Windows Server + XAMPP for php development, specifically, using the SQL Server Database.
Recently, I chanced to a brand new MacBook Pro M2, which is my first experience using macOS.
Right now, I am struggling to make my installation detect the pdo_sqlsrv driver. The phpinfo file doesn't show the sql driver listed. Besides, all the connection attempts shows PDO exception: Could not find driver.
I followed the instructions listed on the following article:
https://learn.microsoft.com/en-us/sql/connect/php/installation-tutorial-linux-mac?view=sql-server-ver16
php -v command returns:
PHP 8.1.12 (cli) (built: Oct 30 2022 12:39:49) (NTS) Copyright (c) The
PHP Group Zend Engine v4.1.12, Copyright (c) Zend Technologies
with Zend OPcache v8.1.12, Copyright (c), by Zend Technologies
sudo CXXFLAGS="-I/opt/homebrew/opt/unixodbc/include/" LDFLAGS="-L/opt/homebrew/lib/" pecl install sqlsrv shows:
pecl/sqlsrv is already installed and is the same as the released
version 5.10.1 install failed
And I also used the sudo CXXFLAGS="-I/opt/homebrew/opt/unixodbc/include/" LDFLAGS="-L/opt/homebrew/lib/" pecl install pdo_sqlsrv command:
pecl/pdo_sqlsrv is already installed and is the same as the released
version 5.10.1 install failed
I added the following lines inside the /Application/XAMPP/etc/httpd.conf file:
<FilesMatch .php$>
SetHandler application/x-httpd-php
</FilesMatch>
Inside manager-osx, the server events tab isn't show any kind of error or warning. Do you guys have any idea of what am I missing, or doing wrong?

I was able to finish the installation using the following link:
https://github.com/microsoft/msphpsql/blob/master/Linux-mac-install.md#installing-the-drivers-on-macos

Related

Apache Netbeans 10 IDE installation

I just tried to install Apache Netbeans 10. It seems someone has introduced a lot of busiwork into the installation process.
In december 2018 I installed Netbeans 8 by
browsing to netbeans.org
clicking a button marked "download"
waiting for the wizard to install
In february 2019, trying to install Netbeans 10, I am instructed to:
fetch zipped files for netbeans
download and install apache ant
unzip netbeans
run ant on netbeans
and whatever else may follow.
Netbeans 8 is still available so obviously I did not waste my time on this new process.
Is this the future, or just a startup issue with Netbeans being transferred to Apache?
How is the introduction of this manual labour progress?
I apologise if this question does not belong on stackoverflow. I don't know where else to ask.
For Linux system follow these simple steps (Apache Netbeans 10 per-requisites must be satisfied before going further):
Download script from apache-netbeans-10.0
Open terminal in directory where above file is downloaded and run below command
sudo chmod +x ./Robo3T-Installation-Menu.sh
Then type below command and hit enter
./apache-netbeans-10.0.sh
Just wait to complete it, once completed enjoy Apache Netbeans. Search in menu with name "Netbeans".
Linux alternative / no special scripts.
(Netbeans version 14. Might apply to 10, dunno)
Download and verify the installer file from Apache Netbeans
Eg. Apache-NetBeans-14-bin-linux-x64.sh
Change the permissions to make it executable - 777'll do:
chmod 777 Apache-NetBeans-14-bin-linux-x64.sh
then
Apache-NetBeans-14-bin-linux-x64.sh # launches GUI installer
Apache-NetBeans-14-bin-linux-x64.sh --help # lists options
Apache-NetBeans-14-bin-linux-x64.sh --silent # installs without gui
Your DE may then list it, if not try
/bin/sh "/usr/local/netbeans-14/netbeans/bin/netbeans"
to launch
If not there try
find / -mount -name netbeans
to find it
(I got this with guessing and trial and error. There is zero useful documentation on the site - you could look inside the scripts I suppose.)
To add to DE (if not there):
create file /usr/share/applications/Apache-NetBeans.desktop ;
[Desktop Entry]
Encoding=UTF-8
Name=Apache NetBeans IDE 14
Comment=The Smarter Way to Code
Exec=/bin/sh "/usr/local/netbeans-14/netbeans/bin/netbeans"
Icon=/usr/local/netbeans-14/netbeans/nb/netbeans.png
Categories=Application;Development;Java;IDE
Version=1.0
Type=Application
Terminal=0
3 Months later ...
Still on Netbeans 14 and all ok in Alma Linux 8.5 (RHEL Clone) but then upgrade to 8.6 and Netbeans stops working - won't launch. Others having similar issues on macOS and fingers pointing at openjdk 17:
17.0.3.0.6-2.el8_5 working
17.0.4.1.1-2.el8_6 not working
but don't want to downgrade as who knows what that'll break and can't dnf install both at same time so installed Oracle JDK 17 (java version "17.0.4.1" 2022-08-18 LTS ), used "alternative --config java" to set it as default and Netbeans working again.

IBM installation manager 1.8.4 cannot find any packages to install

I’m installing the Websphere Fix pack 8.5.5.12 in our Redhat Linux 6 environment using IBM Installation Manager 1.8.4.
I can start IM and add the repository using the typical steps but for some reason its not picking it up.
I add the repository as follows via the preferences,
/rational/rational/Was855_FP012/
I save the changes and the repository shows but when I go back to the main IM window and hit 1. to install I get,
IBM installation manager 1.8.4 cannot find any packages to install
This directory includes the repository.config file as part of extract of all 3 files
8.5.5-WS-WAS-FP012-part1.zip
8.5.5-WS-WAS-FP012-part2.zip
8.5.5-WS-WAS-FP012-part3.zip
previously we installed the WAS85511 patch using the same method and installed successfully
Also the user owns both the installation manager folder and the repository folders.
Environment details:
IBM Installation Manager
Version: 1.8.4
Internal version: 1.8.4000.20151125_0201
Architecture: 64-bit
WAS FP downloads:
8.5.5-WS-WAS-FP012-part1.zip
8.5.5-WS-WAS-FP012-part2.zip
8.5.5-WS-WAS-FP012-part3.zip
Redhat Linux 6
any help would be appreciated.
Thanks
I was installing from the wrong installation manager instance /rational/imcl-1.8.4/tools/imcl
Had to run from the IM which installed the original Websphere instance and Fix packs.
using /app/IBM/IM/eclipse/tools/
./imcl -c
Also instead of using option 1. to install. Must use option 2. to UPDATE for this particular package.
for certain versions of Websphere you must use a silent install or command line install to install the package and bypass the interactive mode.
For 8.5.5.11 we had to run
/app/IBM/IM/eclipse/tools/./imcl install
com.ibm.websphere.ND.v85_8.5.5012.20170627_1018 -repositories
/rational/Was855_FP012 -installationDirectory /app/IBM/WAS85 -
acceptLicense -sP
which translates to
/app/IBM/YourIMInstall/./imcl install
com.ibm.websphere.ND.v85_8.5.5012.20170627_1018 -repositories
/yourRepolocation -installationDirectory /yourWASInstallPath/
acceptLicense -sP
After the installation completes run the following command to confirm the update
/app/IBM/WAS85/bin/./versionInfo.sh
[appadm#myServer bin]$ ./versionInfo.sh
WVER0010I: Copyright (c) IBM Corporation 2002, 2012; All rights
reserved.
WVER0012I: VersionInfo reporter version 1.15.1.49, dated 4/7/17

Installing mod_mono on Mac OSX 10.9 "Mavericks"

I'm trying to install mod_mono on mavericks, however, I'm getting an error. I have the most up-to-date mono version with Mavericks support. (v 3.2.3).
When I ./configure --prefix=/usr in mod_mono version 2.10 I get this error:
checking Apache version... configure: error: Apache 1.3 is no longer supported. mod_mono now requires at least Apache 2.0
But when i check my version of apache it says
Server version: Apache/2.2.24 (Unix)
Server built: Aug 24 2013 21:10:43
EDIT: Upgrading your mono version to the latest (3.2.4) appears to work the best. Ensure you have a clean download of mod_mono-2.10.
After installing Mavericks, you need to reinstall the XCode Command Line Tools. This will bring back the /usr/include/apache2 directory. You do this by updating your XCode and then run xcode-select --install.
I had the same error. I had mono running on my server. When I upgraded to Mavericks and Server 3 mono stopped working. During the upgrade process the "mod_mono.so" file was removed. This is what I did to research and resolve my issue which I believe encompasses yours. Hope it helps.
In the directory that you are running your "./config..." command, there is a "config.log". I looked at the config.log and found an error message stating that it could not find the file "ap_release.h" (I believe this is how the apache version is determined). I must have had this file at one time because I went through this installation process before. I went into my time machine and restored the directory (which was removed when I upgraded to Mavericks or Server 3) "/usr/include/". This folder included a directory called "apache2" which included the "ap_release.h" file and I assume it's dependencies.
All is well I am up and running.

WAMP and SQLSRV: sqlsrv not included in `PDO::getAvailableDrivers()` after install

I've never been able to get SQL Server to play nicely in my WAMP environment, and I trying to finally solve it once and for all.
Tried:
Downloaded the latest SQL Server drivers from microsoft, then extracted and dropped them in my \wamp\bin\php\php5.4.3\ext dir.
I edited both the \wamp\bin\php\php5.4.3\php.ini and \wamp\bin\apache\apache2.4.2\bin\php.ini files to include extension=php_sqlsrv_54_ts.dll.
restarted all WAMP services
checked phpinfo ... no SQLSRV
checked PDO::getAvailableDrivers() ... got only Array( [0]=>mysql, [1]=>sqlite )
Now, I understand that PDO is included natively in PHP 5.3+, but since the MS instructions explicitly requires that extension=php_pdo.dll be enabled, so I figured I'd give that a shot too.
I downloaded the DLL from dlldll.com (1st encounter with that site, so I hoping it's a reputable source), extracted and moved the _php_pdo.dll_ file to my \wamp\bin\php\php5.4.3\ext dir, then added it into both the php.ini files ... no improvement.
As a side note, when I check the list of activated PHP ext's from the WAMPSERVER menu, the sqlserver extensions don't even show up on the list.
Just to test it out, I also tried uncommenting extension=php_pdo_pgsql.dll in the php.ini's, and that worked just fine ... "pgsql" was included in the avail drivers array.
My setup:
Wampserver 2.2 (64bit), running
Apache 2.4.2
PHP 5.4.3
Win 7 pro 64
What next?
I'm just about out of ideas.
The only thing I can think of is that maybe the SQLSRV drivers are 32bit, and not playing nicely with my 64bit setup ... ooohhh goodness .. I sure hope not.
Any tips/pointers are welcome ... especially if they don't include completely reinstalling ;)
I was able to get the sqlsvr PHP PDO driver working on my slightly older version of WAMP 32-bit. Here is my setup:
WAMP 2.2 (32 bit)
Apache 2.2.21
PHP 5.3.8
Win 7 Pro 64 bit
Here is what I did:
Downloaded the MS 3.0 drivers from here: http://www.microsoft.com/en-us/download/details.aspx?id=20098
Unpacked all of the files into the PHP ext folder (C:\wamp\bin\php\php5.3.8\ext)
Added this line to my apache php.ini file (C:\wamp\bin\apache\Apache2.2.21\bin\php.ini)
extension=php_pdo_sqlsrv_53_ts.dll
Downloaded and installed MS SQL Server 2012 Native Client ODBC driver from here: http://go.microsoft.com/fwlink/?LinkID=239648&clcid=0x409
After these steps my PHP code happily connected to my SQL Server database.

Uninstalling user install of Apache on Mac Mini

I got a MacMini at work for development, and was asked to follow this article to install SVN on it: http://developer.apple.com/tools/subversionxcode.html The article assumes that only Apache 1.3 was installed and asks the reader to install Apache 2. I've since learned that the MacMini has Apache 2 already installed. So basically I've installed two versions of Apache 2. The preinstalled one has access to PHP, so I wanted to remove my version, but I'm unsure of how.
My version has httpd.conf stored at:
/usr/local/apache2/conf/httpd.conf
And the preinstalled version has it stored at:
/etc/apache2/httpd.conf, which I believe is an alias for /private/etc/apache2/httpd.conf
Thanks for your help
Delete the Apache2 folder from the location you specified, /Library/StartupItems/Apache2, and /Library/Receipts/Apache2.pkg according to:
http://www.glinder.com/bulkfiles/UNIXInfo/Apache2_Install_Guide.pdf