Laravel login from sqlite DB, getting "PDOException could not find driver" - forms

I am trying to write a simple login form using Laravel and sqlite DB on localhost (vagrant and virtualbox). However, after entering username and passoword I keep getting "PDOException could not find driver" error. Any ideas?
--- EDIT ---
Had to install sqlite driver by typing
sudo apt-get install php5-sqlite
in my terminal window. It was somehow not enabled by default :/

It sounds like your version of PHP is either missing, or has disabled, the PDO extension. Use the phpinfo function to list out the extensions installed and enabled. If PDO isn't there, look for a commented line in your php.ini file(s) and/or talk to the person maintaining your servers.

Your system has missing php SQLite installation.
Install it by using:
sudo apt-get install php7.0-sqlite

Related

Linking postgresql in homebrew

I already installed postgresql, but it says I did not link to it.
I am running this in the command line and getting the following error:
myname#MacBook-Pro-8 ~> brew install postgresql
Warning: postgresql 10.4 is already installed, it's just not linked
You can use `brew link postgresql` to link this version.
myname#MacBook-Pro-8 ~> brew link postgresql
Linking /usr/local/Cellar/postgresql/10.4...
Error: Could not symlink share/man/man7/ABORT.7
/usr/local/share/man/man7 is not writable.
myname#MacBook-Pro-8 ~> sudo brew link postgresql
Password:
Error: Running Homebrew as root is extremely dangerous and no longer supported.
As Homebrew does not drop privileges on installation you would be giving all build scripts full access to your system.
I also tried:
brew prune; brew link postgresql
which gave me the same error:
Error: Could not symlink share/man/man7/ABORT.7
/usr/local/share/man/man7 is not writable.
Why is that folder not writable and what can I do to change that?
It was really painful solving this problem, so I figured I would leave it here for others to see.
Issue:
Homebrew install of Postgresql will not execute successfully. $ brew link postgresql results in failure due to directory not writable. New version of Homebrew will not allow sudo commands and System Integrity Protection prevents changing permissions.
Details:
I tried to use homebrew to install postgres and kept running into issues with syslink. When I ran $ brew link postgresql as homebrew suggested, I kept running into an error that it couldn't be completed because certain folders were not writable. I thought this would be easily remedied by running sudo but unfortunately the most current version of homebrew no longer allows the use of sudo commands due to security risks. My next thought was to my root user and use the macOS GUI interface to change the permissions on this folder because I am not sure how to do this on the terminal. Regardless of being logged in as 'root,' the OS would not let me change the permissions of the folder. I also attempted to use sudo and change the permissions in terminal and it did not work either. After several days of banging my head against the wall try all kinds of things to find a solution, I discovered that since El Capitan, macOS introduced System Integrity Protection aka 'SIP' or 'rootless.' As it turned out, once I disabled SIP, logged back into 'root' and changed my regular accounts permissions to Read/Write on the problem directories, I was able to go back to my regular account and successfully execute $ brew install postgresql.
(Assuming you currently have postgresql installed through homebrew but unable to link due a scenario like the one mentioned above, here is what I suggest to resolve your issue...)
Run $ brew link postgresql
Write down the directory path that the error says it is not able to write to. (e.g. usr/local/share/man/man7) NOTE: you'll want to actually write this down on paper or take a picture of the screen on your phone because you will not be able to use copy and paste)
Enable your 'root' user account if you have not already done so.
(instructions here) NOTE: make sure to make a really good password for this account and write it down somewhere safe. This is a powerful account and there's no way to recover the password.
Disable System Integrity Protection.
(instructions here)
Log into 'root' user account
In Finder menu bar select GO > GO TO FOLDER... (CMND + SHFT + G) and type in the path from Step 2.
Right-Click/ Cntrl-Click the folder and select Get Info
Click the plus sign at the bottom of Sharing & Permissions
Add your regular account to the list and change the permission to Read & Write
Go back to your regular account, run $ brew uninstall postgresql, then $ brew update and $ brew doctor . If those are all set run $ brew install postgresql.
You should be able to install without any problems now. However, if you run into a linking and permissions problem again, run $ brew link postgresql to figure out the problematic directory and repeat Steps 5 - 10 with whatever other directories are giving you trouble.
If everything is up and running properly. It is probably best to at least enable SIP again (instruction in the article linked in Step 4).
(To check that everything is working. I recommend running $ brew services start postgresql then $ createdb 'test' . In my case, it was when I originally tried to run createdb and got "command not found" that I realized something was wrong.)
Running this solves it. This gets around SIP.
sudo chown -R $(whoami) $(brew --prefix)/*
brew link postgresql

MySQL Workbench Closes Unexpectedly

I'm using CentOS 6.4, and did
sudo yum install mysql-workbench-community.x86_64
That installed MySQL workbench version 6.1
When I launch the application it lists MySQL Connections, and has a box for Local instance 3306.
When I double click that box the app just closes. WTH?
edit: it's printing this on the console
/usr/libexec/mysql-workbench/mysql-workbench-bin: symbol lookup error: /usr/lib64/mysql-workbench/libwbscintilla.so: undefined symbol: gtk_widget_get_realized
If you've got the same issue like me with Workbench unexpectedly crashing it's easy to resolve:
Edit -> Preferences -> tab "general" and check "Force use of software based rendering for EER diagrams"
At least it's worth a try!
I too was experiencing same problem (on CentOS 6.4). I followed what they concluded on this bug report file. I installed the Workbench 6.0.9 release and the problem is gone.
If you've got the same issue like me with Workbench unexpectedly crashing while opening previous session with tables then just clean up sql_workspaces folder with their sub-directories:
rm -rf ~/.mysql/workbench/sql_workspaces/*
Unfortunately I have the repetition of this event every time so I created the alias in my ~/.bashrc (pro-)file:
alias fix_workbench='rm -rf /home/user/.mysql/workbench/sql_workspaces/*'
P.S.: My MySQL Workbench's version is: 8.0.12. The debug log is too long, including Register/Memory dumps and Backtrace.
As plan B you can also use dbeaver. It works on all OS.
https://dbeaver.io/download/
You better read what platforms are supported by MySQL Workbench: http://www.mysql.com/support/supportedplatforms/workbench.html. The Linux world is so shattered, it's very difficult to support all flavours. And of course always my own is certainly one that should be amongst the supported platforms...
Had same issue CentOS 6.4 :
/usr/libexec/mysql-workbench/mysql-workbench-bin: symbol lookup error: /usr/lib64/mysql-workbench/libwbscintilla.so: undefined symbol: gtk_widget_get_realized
Installed gtk2 devel libraries.
yum install gtk2-devel
Problem solved.
Thanks
Prasad
Centos6.8, Mysql80, Mysqlworkbench8.0.17
I have encountered same problem。 tried to install other version, but not worked; tried to install gtk2, not worked as well. Finally, I thought maybe the version was not correspond, so I install gtk3, it's worked.
What worked for me were very simple steps:
Downloaded a previous version of MySQL Workbench just in case
If it still shuts down when opening the app then verify that there is no app using mysql (for example a website you are building or whatever project you are working on) Stop them all
Do not open the workbench and stop the mysql server in the command line:
sudo service mysql stop
Now with mysql stopped open MySQL Workbench and open any connection
Once inside, MySQL should obviously not be running so now:
sudo service mysql start
Voila!

Phalcon: server not reachable through ip after installation

I tried to install Phalcon on CentOS 6.5. This is what I did:
Edit etc/yum.conf: remove the line ‘exclude=’ (temporarily)
Terminal:
Sudo yum update (to update everything on the system)
Yum install php-devel
Sudo yum install git
git clone git://github.com/phalcon/cphalcon.git
cd cphalcon/build
sudo ./install
Add a file called phalcon.ini in /etc/php.d/ with this content:
extension=phalcon.so
Put back the original etc/yum.conf file
Reboot server.
Before I rebooted the server, "Apache is functioning normally" was displayed when I typed the IP address in my browser. Now when I got there, I get a browser message about being unable to establish a connection. When I type :2222 after the ip address, I can get access to directadmin.
What did I do wrong? (this is the second time I tried to reinstall it completely...)
Thank you very much
Phalcon should be loaded after all other PHP extensions are loaded. This has to do with the patches used by CentOS: they change the way the extensions are loaded into PHP.
I would remove extension=phalcon.so from php.ini and create /etc/php.d/zz-phalcon.ini with
extension=phalcon.so
and restart the web server.
EDIT: I explained this in details in the official forum.
You can't properly install Phalcon when using DirectAdmin.

pgAdmin III (pgadmin3_92.x86_64 0:1.16.1-1.rhel6 ) won't start

OS on which I've isntalled pgAdmin: Centos 6.3
Postgresql 9.2 is installed on another machine (not sure if this matters)
Have installed pgadmin3_92 via postgresql repo.
When I go: Applications > Programming > pgAdminIII, and select, nothing happens.
When I enter pgadmin3_92 into the terminal I get
pgadmin3_92: error while loading shared libraries: libpq.so.5: cannot open shared object file: No such file or directory
I've tried a Google search for this error and it came back with no results. I'm only new with Linux/Centos so I've reached the limit of what to do next to figure out how to get pgAdminIII working.
Any ideas on what to look for/do next?
The error is caused by Centos not being able to find the shared libraries to run the application.
My pgadmin3 library files are installed at: /usr/pgsql-9.2/lib
I ran ldd pgadmin3 as per hints here, this confirmed that the shared library could not be found to run pgadmin.
Also on the same link it shows to change to root user: su - root, and then create a .conf file that points Centos to where the libraries are for pgadmin3. The command to create this file is:
echo /usr/pgsql-9.2/lib > /etc/ld.so.conf.d/pgsql-9.2.conf
For someone else this would be:
echo <location of pgadmin3 libraries> > /etc/ld.so.conf.d/pgsql-9.2.conf
I then ran: cat /etc/ld.so.conf.d/pgsql-9.2.conf to confirm the file had been created and the location of the libraries had been written to the file.
I then ran the following to ensure Centos was refreshed with this new configuration info:
/sbin/ldconfig
I was able to run pgadmin3 after this.
yum install postgresql92
If it is not enough then
yum install postgresql92-libs

Installing PDO-drivers for PostgreSQL on Mac (using Zend for eclipse)

How can I get PDO to work on my mac (os x 10.5)? I'm using the built in php and php in Zend/Eclipse. Can't seem to find useful drivers for it at all.
I had to install the PDO_PGSQL driver recently on Leopard, and I ran across a multitude of problems. In my search for answers, I stumbled across this question. Now I have it successfully installed, and so, even though this question is quite old, I hope that what I've found can help others (like myself) who will undoubtedly run into similar problems.
The first thing you'll need to do is install PEAR, if you haven't done so already, since it doesn't come installed on Leopard by default.
Once you do that, use the PECL installer to download the PDO_PGSQL package:
$ pecl download pdo_pgsql
$ tar xzf PDO_PGSQL-1.0.2.tgz
(Note: you may have to run pecl as the superuser, i.e. sudo pecl.)
After that, since the PECL installer can't install the extension directly, you'll need to build and install it yourself:
$ cd PDO_PGSQL-1.0.2
$ phpize
$ ./configure --with-pdo-pgsql=/path/to/your/PostgreSQL/installation
$ make && sudo make install
If all goes well, you should have a file called "pdo_pgsql.so" sitting in a directory that should look something like "/usr/lib/php/extensions/no-debug-non-zts-20060613/" (the PECL installation should have outputted the directory it installed the extension to).
To finalize the installation, you'll need to edit your php.ini file. Find the section labeled "Dynamic Extensions", and underneath the list of (probably commented out) extensions, add this line:
extension=pdo_pgsql.so
Now, assuming this is the first time you've installed PHP extensions, there are two additional steps you need to take in order to get this working. First, in php.ini, find the extension_dir directive (under "Paths and Directories"), and change it to the directory that the pdo_pgsql.so file was installed in. For example, my extension_dir directive looks like:
extension_dir = "/usr/lib/php/extensions/no-debug-non-zts-20060613"
The second step, if you're on a 64-bit Intel Mac, involves making Apache run in 32-bit mode. (If there's a better strategy, I'd like to know, but for now, this is the best I could find.) In order to do this, edit the property list file located at /System/Library/LaunchDaemons/org.apache.httpd.plist. Find these two lines:
<key>ProgramArguments</key>
<array>
Under them, add these three lines:
<string>arch</string>
<string>-arch</string>
<string>i386</string>
Now, just restart Apache, and PDO_PGSQL will be up and running.
Take a look at this PECL package: PDO_PGSQL
I haven't tried it myself, but I've been interested in playing with Postgres as an alternative to MySQL. If I have a chance to try it soon, I'll throw my results up here in case it helps.
I'm not sure this will help with the PDO drivers specifically, but you might look into BitNami's MAPPStack.
I had a ton of trouble with Postgres, PHP, and Apache on my Mac, some of it having to do with 64- vs 32-bit versions of some or all of them. So far, the BitNami MAPPStack install is working nicely in general. Maybe it will help with your PDO issues as well.
Install new php version via brew and restart server, and php -v, all issues are removed.
This is what worked for me
brew install php55-pdo-pgsql
This installs PHP 5.5.32 and PostgreSQL 9.5. I already had PostgreSQL 9.4 installed so I uninstalled the homebrew version with:
brew uninstall postgres
You then have to update /etc/apache2/httpd.conf to point to the correct PHP version and restart Apache:
LoadModule php5_module /usr/local/Cellar/php55/5.5.32/libexec/apache2/libphp5.so
My OSX version is Yosemite.