Activating PHP extensions in Bluemix

对着背影说爱祢 提交于 2019-12-05 15:08:24

The options.json file is correct that you have posted. However it is in the wrong directory, it should be in a folder called .bp-config/. Renamed the folder and repush your app back to Bluemix.

Also try adding pdo_mysql to .bp-config/options.json.

I just tested some code with the PDO driver against a DB and it worked fine. My .bp-config/options.json file is below.

{
    "PHP_EXTENSIONS": ["pdo", "mysqli", "pdo_mysql", "mysql"]
}

I would double check your access to the database with a MySQL desktop client. It looks like an issue with your connection information.

I have an example app for testing your connection information with PDO.

The instructions to add the options.json file are the correct ones and from your screenshot the file looks to be correct. The problem is the directory that you placed the options.json file in you have called .bgconfig when it should be .bp-config.

Can you change the directory name, repush the app to Bluemix and it should work.

Do you have mysql defined in your composer.json?

{
  "require": {
    "ext-mysqli": "*"
  }
}

https://github.com/IBM-Bluemix/php-mysql

you can add extension in composer.json file

{
  "require": {
    "ext-mysqli": "*",
    "ext-gd": "*"
  }
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!