Hhvm: PHP-MSSQL Undefined Functions.

Created on 15 Jan 2014  ·  27Comments  ·  Source: facebook/hhvm

Normally we use php-mssql and connect through php-fpm or whatever. With HH I get it as an undefined function. I'm assuming this hasn't been ported over yet, or I just need to compile something in?

We are a weird shop who happens to use mssql as the backend instead of mysql.

I apologize if this has been discussed for other functions, still doing research. I'd look into implementing these if they haven't been ported, but not sure where to really start :)

HipHop Fatal error: Undefined function: mssql_connect
HipHop Fatal error: Undefined function: mssql_pconnect

Thanks!

feature request missing extension

Most helpful comment

@aorenste we're an art university – our students could provide great artwork depicting our frustration about the missing MSSQL support – would that be helpful? ;)

I'll look into making it myself, but my C++ is really rusty, I don't know much about PDO, and don't like MSSQL…

All 27 comments

Thanks for reporting this. This is indeed an extension we haven't implemented.

@aatch implemented support for PostgresQL here which is probably the best reference of what to do if you want to go about implementing the mssql extension: https://github.com/PocketRent/hhvm-pgsql

hi ,@cupton3,I am a little busy recently, have no time to migrate to the DSO, wait me time pull request to the official.
Thanks.

Hi @huzhiguang, do you have time for it yet? I'm able to make it work by self building, but it would be cool to get it in master.

I too would love to see MSSQL supported in core, I work in education and its the only DB we use.

@clementhk ,I recently time is less, you see if you have time to migrate mssql code to the dso?This job don't diffcult.^_^

@scannell I think https://github.com/kastermester/hhvm-pgsql could be a much better approach, I could try it in 2, 3 weeks.
I also read some weeks ago that hhvm now supports zend extensions, does it mean anything to pdo/pdo-dblib?

:+1: for this extension to be implemented. This is holding me back from using HHVM.

@hhellbusch ,Just don't have time to migrate to the DSO mode

We are about to migrate a simfony app to hhvm, we installed the hhmv interpreter but...

FACEPALM! no support extension for MSSQL... we use MariaDB and MSSQL databases so this block all our project migration to hhvm.

Like US I am sure a lot of people uses MSSQL databases and dont start using hhvm beacuse of this
Support for some commercial databases like MSSQL and Oracle should be mandatory, please raise priority for this.

@huzhiguang 能不能把最新代码发给我我看看?工作量不大的话我就整进去

Guys, I'll take a look next week, hopefully with the help from @huzhiguang, but I only use PDO dblib, so whoever want the rest to be working should give me a list of needed features and tests.
Keep in mind that the less features that are required, the better chance I will write it :)

(I'll be glad to help Baidu hackers if they need help getting their code upstream.)

At least for us, the most used functions are:
mssql_fetch_row
mssql_select_db
mssql_connect
mssql_num_rows
mssql_free_result
mssql_query
mssql_select_db
mssql_get_last_message
mssql_close
mssql_data_seek
mssql_bind
mssql_init
mssql_execute
mssql_fetch_array

If you can make this, I think could be enought for a initial version, and should be included in core.

@clementhk
我已经很久没有维护MSSQL这个扩展了,这个扩展是我在京东上班时开发的,但是我很愿意帮助你开发这个扩展迁移到DSO

I haven't maintenance MSSQL extension for a long time,this extension is when I was in JD company development,but I'm willing to help you develop this extension to DSO

Thank you so much guys.
You rocks!

+1 for MSSQL support, I'm open to helping write an extension if we can get a base repo together

I'm going to attempt some of the groundwork for an extension if anyone wants to help out, it's been a long time since I've really got stuck in to C++ but I'll focus on laying the initial skeleton of the plugin out to reflect that of the PHP docs.

Repo can be found at: https://github.com/euphio/hhvm-mssql

Please feel free to fork / add issues / join in

Any news on this one? It's the only thing we still run on php-fpm and it's a shame to miss the performance benefits of hhvm

You might have better luck opening an issue on @euphio's repo or contributing PRs there if you're so inclined.

This is the most information I could find on using MS SQL Server with HHVM. I am currently using the pdo_dblib extension with FreeTDS to connect PHP 7 to a MS SQL database.

Has pdo_dblib been ported to HHVM or are there any plans to do so? Unfortunately, this is the only thing keeping me from being able to use HHVM.

@wjbryant Bit off topic, but do you use stored procedures with PHP 7 and MSSQL? They don't return parameters for me.

@craigcarnell Yes, we are using stored procedures and we also do not get any return values. I think this is a limitation of the setup. We ended up writing SQL like this in our stored procedures:

SELECT @ReturnValue AS result
RETURN @ReturnValue

Then we can grab the value of the "result" column in the first row of the result set. If return values begin working in the future, we can just ignore the result set.

@wjbryant Thanks, I will try that :+1:

This feature request is not actively being worked on. We would happily consider a pull request implementing it. If you plan to work on this issue let us know in the comments and we will re-open the issue and assign it to you. If you feel strongly that this issue deserves more attention, please comment here with your use-case and we will try to prioritize as appropriate.

We're an university and we consider switching to HHVM & Hack but all our student and course data is in a MSSQL DB and can't be moved… Also several other systems, we need data from, use MSSQL and don't provide a proper API. So we do feel strongly that this feature needs more attention.

Because ext/mssql has been removed in PHP7, it's probably not wise to implement it for HHVM, but a PDO library for MSSQL would be great!

@beatrohrer It's unlikely we'll have time to implement this ourselves but we'd be happy to accept a pull request for it (maybe a student project?)

@aorenste we're an art university – our students could provide great artwork depicting our frustration about the missing MSSQL support – would that be helpful? ;)

I'll look into making it myself, but my C++ is really rusty, I don't know much about PDO, and don't like MSSQL…

Was this page helpful?
0 / 5 - 0 ratings

Related issues

karek314 picture karek314  ·  6Comments

Sakretsos picture Sakretsos  ·  7Comments

acrylic-origami picture acrylic-origami  ·  4Comments

octmoraru picture octmoraru  ·  5Comments

ZhijieWang picture ZhijieWang  ·  6Comments