Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQLite Requirement for Running Laravel Tests #70

Closed
allella opened this issue Oct 5, 2020 · 3 comments · Fixed by #71
Closed

SQLite Requirement for Running Laravel Tests #70

allella opened this issue Oct 5, 2020 · 3 comments · Fixed by #71

Comments

@allella
Copy link
Member

allella commented Oct 5, 2020

@zach2825 On the earlier SQLite stuff, I had to change my local composer.json to the following since the staging server is only
running PHP 7.3.

"ext-sqlite3": "^7.3",

Since Composer isn't actually installing a package it might be best to set this to a lower minor version to match the PHP minimum version in composer.json, like

"php": "^7.2.5",
...
"ext-sqlite3": "^7.2",

Also, I had to enable two PHP extensions in my php.ini, or rather

/etc/php.d/20-sqlite3.ini
extension=sqlite3

/etc/php.d/30-pdo_mysql.ini
extension=pdo_sqlite

In my case, on CentOS 7, these were enabled using the aforementioned /etc/php.d/ configuration files because I guess SQLite is now a core PHP 7 extension.

In Ubuntu, running apt-get to "install" an extension may just enable it in the similar core extension configuration files, but that's just a guess because I haven't installed it locally to see.

The composer.json warnings should be pretty helpful when someone runs php artisan test and they are missing an extension as it will show an error like

  • The requested PHP extension ext-sqlite3 ^7.3 is missing from your system. Install or enable PHP's sqlite3 extension.

I'm not sure if we want to update the README with notes on how to enable these extensions since it can differ so much between OSes. Thoughts?

@zach2825
Copy link
Collaborator

zach2825 commented Oct 5, 2020

Definitely, its good to have something in the readme. That way it creates a reference point. I document things for ubuntu. I'd like to add a docker image eventually so people can just run that instead of having to set up an environment. I would do it for ubuntu, even thou production, and stage use centos.

I can configure ubuntu super quick and enable PHP debugging and everything pretty quickly too.

@allella
Copy link
Member Author

allella commented Oct 5, 2020

Alright, I don't have a fork setup yet for the HG repo.

Would you do a PR for those composer.json changes, above, and any README testing notes?

@allella
Copy link
Member Author

allella commented Oct 5, 2020

I meant to add above that I think we need this in the composer.json too.

"ext-pdo_sqlite": "^7.2",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants