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

mysqli library missing #22

Closed
whitfiea opened this issue Aug 20, 2014 · 13 comments

Comments

Projects
None yet
3 participants
@whitfiea
Copy link

commented Aug 20, 2014

Hi,

I have been using this buildpack in cf/bluemix and everything was working as expected with my PHP/mysql app. Then the recent buildpack update to PHP 5.4.31 has broken my app as the mysql_* and mysqli_* functions are no longer found as the mysqli extension doesn't appear to be installed by default.

Was this an expected change?

@dmikusa-pivotal

This comment has been minimized.

Copy link
Member

commented Aug 20, 2014

Yes. Sorry for the disruption. I've been adjusting the binaries to compile more things as shared libraries / extensions. It helps to keep the individual downloads smaller and memory usage lower.

I would suspect that you're getting an error because the mysqli extension is now an extension. You just need to enable the library in .bp-config/options.json link. See the PHP_EXTENSIONS config option.

Ex:

{
    "PHP_EXTENSIONS": ["mysqli"]
}

Note that setting this will override the defaults, so if you need any other extensions you should add them here as well.

Sorry again for the change.

@whitfiea

This comment has been minimized.

Copy link
Author

commented Aug 20, 2014

Adding the PHP_EXTENSIONS to the options.json works for me.

Thank you.

@whitfiea whitfiea closed this Aug 20, 2014

@dmikusa-pivotal

This comment has been minimized.

Copy link
Member

commented Aug 20, 2014

Awesome, thanks for confirming!

@ghost

This comment has been minimized.

Copy link

commented Oct 28, 2014

Note for people reading this in futuer: you need to specify mysql or mysqli in the PHP_EXTENSIONS list depending on which one you need.

@anirudhbagri

This comment has been minimized.

Copy link

commented Jun 3, 2018

How to add PHP_EXTENSIONS in PCF? I am not able to find .bp-config/options.json. Do I need to create a new build-pack?

@dmikusa-pivotal

This comment has been minimized.

Copy link
Member

commented Jun 4, 2018

FYI, while PHP_EXTENSIONS still works. It has been deprecated in favor of the method describe here.

https://docs.cloudfoundry.org/buildpacks/php/gsg-php-config.html#php-extensions

@anirudhbagri

This comment has been minimized.

Copy link

commented Jun 4, 2018

Got it. Thanks a lot!

But how do I enable the extension in the build-pack?

@dmikusa-pivotal

This comment has been minimized.

Copy link
Member

commented Jun 4, 2018

You don't. You follow the instructions in the docs to enable PHP extensions for your application.

Is there a reason why you want to enable it in the buildpack?

@anirudhbagri

This comment has been minimized.

Copy link

commented Jun 4, 2018

My bad, I just want to enable it for my application, but I am not able to understand how to enable it in it my application as I am not able to find any .bp-config folder in my app.

@dmikusa-pivotal

This comment has been minimized.

Copy link
Member

commented Jun 4, 2018

No worries. .bp-config is a folder that is specific to the buildpack. It's where it looks for configuration. You don't need to have that folder with your app, but if you want to override the default configuration used by the buildpack, for example to enable specific PHP extensions, you would need to create the .bp-config under the root of your project (i.e. where you run cf push).

@anirudhbagri

This comment has been minimized.

Copy link

commented Jun 4, 2018

I want to add sqlite extension in my application. However I am not able to create .bp-config folder. (I am on windows machine).
After I create this folder do I need to create this? another folder structure like php/php.ini.d/mysqli.ini?

@dmikusa-pivotal

This comment has been minimized.

Copy link
Member

commented Jun 4, 2018

You can create this folder on Windows. You might need to tell File Explorer to show hidden files. You could also do it via the Command Prompt or Powershell.

After I create this folder do I need to create this? another folder structure like php/php.ini.d/mysqli.ini?

Yes. You need to create the folder structure exactly as described in the docs.

@anirudhbagri

This comment has been minimized.

Copy link

commented Jun 4, 2018

Thank a lot man!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.