Comments (16)
@maicolcantagallo More info about adding mongodb driver can be found in #169
from s2i-php-container.
Thanks @omron93 but i did not understand how to make the configuration. I've created a source code pods and a mongodb storage pods. Am I doing something wrong?
from s2i-php-container.
Thanks @omron93 but i did not understand how to make the configuration. I've created a source code pods and a mongodb storage pods. Am I doing something wrong?
I think you do it right. Mongo driver has to be somehow installed in your source code pod to be able to access database.
from s2i-php-container.
thanks @omron93 but I do not understand how to install mongo db inside the pod.
when i lunch command pecl install mongodb-1.3.0 return Cannot install, php_dir for channel "pecl.php.net" is not writeable by the current user
from s2i-php-container.
@maicolcantagallo As a quick work around, please see the below instructions for using a PHP S2I image that I had created specifically to include the mongodb drivers. This is a workaround until I can update #169 to allow users to pecl install
themselves.
In the web console, go to Builds > Builds. Click on the name of your application, and then under Actions, select Edit. Next change Build From to "Docker Image", and specify the following image depending on your version of PHP:
wgordon/openshift-s2i-php-56:latest
for PHP 5.6wgordon/openshift-s2i-php-70:latest
for PHP 7.0
Then hit save! That's it. This is also assuming that you already have a composer.json file that includes "mongodb/mongodb". You can see an example of that here.
from s2i-php-container.
thanks @wgordon17 . do I have to import Docker Image source into my php source codes or do I have to insert an external path?
from s2i-php-container.
When start build application return this error
Pulling image "maicolcantagallo/s2i-php-container/7.0" ...
pulling image error : unauthorized: authentication required
error: build error: unable to get maicolcantagallo/s2i-php-container/7.0:latest
from s2i-php-container.
Hi @maicolcantagallo, you don't have to import it at all, you can just change the Build From
value. Also, you have to specify Docker Image
and use "wgordon" to pull from my DockerHub account
from s2i-php-container.
Thanks @wgordon17 . Now return this error
Pulling image "wgordon/openshift-s2i-php-70:latest" ...
pulling image error : manifest unknown: manifest unknown
error: build error: unable to get wgordon/openshift-s2i-php-70:latest
from s2i-php-container.
Sorry, i was wrong to choose php version
from s2i-php-container.
First step it's ok. Where is composer.json? I can't find it in my source
from s2i-php-container.
@maicolcantagallo It's a file to tell Composer what dependencies are necessary to install. In the case of MongoDB, you need both the drivers (solved with my custom Docker image), and the extensions (solved by Composer).
Your composer.json file can be a very simple
{
"require": {
"mongodb/mongodb": ">=1.0"
}
}
Add that to your git source, and re-build. The PHP S2I image handles the rest!
from s2i-php-container.
now works fine!
Thanks @wgordon17
from s2i-php-container.
sorry @wgordon17 another question. If i want to use MongoClient instead of MongoDB\Driver\Manager is possibile?
Thanks
from s2i-php-container.
@maicolcantagallo MongoClient has been deprecated, I'm not familiar enough with it to know how to install it. Sorry
from s2i-php-container.
Since MongoClient has been deprecated, then I am closing this issue. Feel free to reopen it in case it is still valid.
from s2i-php-container.
Related Issues (20)
- ENV and FPM HOT 2
- allow easily consuming kubernetes TLS secrets HOT 1
- tests suite failure: blocker composer plugin HOT 1
- PHP 8.1 build - It's the latest/greatest/fastest and we're anxious to start using it. HOT 11
- AH02282: No slotmem from mod_heartmonitor
- Testing issue created for samples operator HOT 1
- Feature request: Support custom certs for composer HOT 1
- Executing `test_scl_usage` when tty exists waits on 'cat' forever HOT 5
- No Action Required !! Testing automation workflow HOT 1
- No Action Required !! Testing automation workflow HOT 1
- How to get PHP 8.0.28 ? Multiple vulnerabilities in PHP 8.0.20 HOT 2
- Incomplete ssl test
- Run script error HOT 2
- 8.1 version of s2i-php-container web server user does not get the environment variables (env) secrets from Openshift HOT 2
- Environment variables are being ignored by the php engine HOT 4
- php-fpm issues (container runtime) HOT 4
- PHP version leakage HOT 5
- Default fpm settings easily lead to out of memory events or OOMkiller being active HOT 1
- Add support for PHP-8.2 to Fedora HOT 1
- PHP 8.3 timeline / PHP 8.3 is measuring+53% faster than 8.2 - HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from s2i-php-container.