I tried to connect to a local postgre Database with PDO using PHP.
When running my code, the error message showed: Fatal error: Uncaught PDOException: could not find driver in {file path}
After googling, it looks like updating the PDO extension is a way fixing it.
Then I tried to use the code here.
When executing line 21 ./configure --with-pdo-pgsql="/Library/PostgreSQL/9.3/"
, the error message is shown:
configure: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path
p.s. I check the setting of my Postgres, the paths are shown below, do I need to change path to one of those?
Then I googled for the error again. There are a number of post indicate that using yum -y install postgresql-devel
But the error shows again when I tried to run the code: -bash: yum: command not found
This is a confusing journey of PHP beginner tried to figure out getting data from a database using
PHP. Can someone provide a way to do achieve this (On Mac) ?
The problem is solved when changing my local server from xampp to mapp.
Related
I had a perfectly running local test environment with:
Oracle Linux 7 using httpd
PHP 7.4
Oracle DB 18c XE
several vhosts
Then I had to install the IMAP extention, and got this final message.
My local pages don't work anymore, and a look at the error log confirm my suspicion that it's because something happened to the OCI8:
PHP Fatal error: Uncaught Error: Call to undefined function oci_new_connect() in /var/www/
Finally, phpinfo() shows that there is indeed no OCI8.
Has anyone a way to solve this without much fuss? I checked and the correct OVI-8 version is still on my machine.
I brew installed the php#7.2 and now I restarted the php but I am not able to start the service. I tried checking php version using php -v and I am getting the following error:
php -v
dyld: Symbol not found: __ZNK6icu_698Calendar3getE19UCalendarDateFieldsR10UErrorCode
Referenced from: /usr/local/Cellar/php#7.2/7.2.34_4/bin/php
Expected in: /usr/local/opt/icu4c/lib/libicui18n.69.dylib
in /usr/local/Cellar/php#7.2/7.2.34_4/bin/php
Can someone help me resolve this? I have spent numerous hours in this setup and installed and reinstalled php and everything still getting the same error. I tried cleaning everything up and doing the fresh installation but still I couldnot run it successfully.
I was trying a PHP script in the terminal yesterday but it didn't work. Not thinking the script could have errors i reinstalled php7.0-cli and when installing it asked something about how i want to do something, i can´t remember what it asked for exactly. Anyhow i pressed the use local something option and after that i´m not finding my mysqli when trying to run the PHP file in terminal.
I´m getting a error like this:
Fatal error: Uncaught Error: Class 'mysqli' not found in /var/www/mysite/system/library/db/mysqli.php:7
I have tried reinstalling the PHP extensions and i have tried to uncomment the extensions from my php.ini file.
I am trying to install ImageMagick on my Mac using MAMP using homebrew.
In the terminal I am not getting the following message:
Warning: php53-imagick-3.1.0RC2 already installed
When trying to run the install script, which was apparently successful, however I still receive the following error when trying to use ImageMagick from PHP:
Fatal error: Class 'Imagick' not found in....
I'm amazed at how difficult this has been, if anyone could help me out it would be greatly appreciated.
I'm looking for some help to get rid of this error. As i'm running mac os x 10.5 I had to install A newer version of php to support pdo. I did this using Marc Liyanage's installer package.
The problem I'm having now is that using php from the command line is invoking the default apple php, not the pdo enabled version causing bake to fail.
How can I get the bake command to use the correct version of php on my system?
Many Thanks
Ralph
you could specify the path to the new php.. ?
/path/to/new/php/php script_to_run.php
There may be an alternatives package under osx as well where you can specify which versions of which apps you can use.
I was getting the following error while trying to bake v2.3.1
Warning Error: PDO::__construct(): [2002] No such file or directory
(trying to connect via unix:///var/mysql/mysql.sock) in
[/Library/WebServer/third-party/frameworks/cake_2.3.1/lib/Cake/Model/Datasource/Database/Mysql.php,
line 158]
Error: Database connection "Mysql" is missing, or could not be created.
Fixed the issue by modifying pdo_mysql.default_socket in php.ini to point to right socket file path.