Searching for php library

I would like to implement a chat-completion in php and I saw this library on this site:

Unfortunately it supports PHP 8.1 onwards and I can use PHP 5.6
Can anyone suggest me another library?
Or I was thinking of using curl instead of php because it seems to me that in this case a library is not needed… but I could be wrong so any advice is welcome!

You can always use plain curl functions, the API is pretty easy. But PHP 5.x stopped getting updates 4 years ago and is a security liability. I’d highly suggest finding a way to upgrade to 8.x.


perfect thank you very much!
yes I know, but unfortunately the development and testing environment I use at work at the moment only has this option…

how much did you search? there are like, 4 or 5, competing openai PHP libraries.
put some more effort into your search

1 Like

They’re probably having trouble with one that runs with 5.x PHP… they’re gonna likely have to write their own cURL to connect…

if you are running php 5.x you have bigger problems than selecting an openai library :smiley:

1 Like

Concur! :wink:

I haven’t heard that version mentioned in years and years…

yes I know. I went through various sites but they all support PHP version 7 onwards. I know PHP 5.6 is very old, but it’s the one I have and the one I have to use, no need to keep saying it

What you’re going to have to do is start by taking a php 7 library and trying to get it working with 5.x on your machine. I would probably look at the upgrade notes and see if you can find where the problem might be so you can translate.

You might try asking GPT-4 as well, but don’t expect miracles.