0

This is a peculiar requirement

I am doing this on a vendor router so I do not have much control over things. I can not load my own PHP or modify php.ini etc.

Addition:

Actually PHP is running just as a Apache Module. What options do i have to connect to PostgreSQL database. Though PHP version is PHP Version 5.3.2 - Its is extremely stripped down version of it.

Requirement:

There is a PostgreSQL database on this router and I need to access it using the barebones PHP that is available on the router.

Is there a way I can add the PostgreSQL libraries along with my own files and connect to the PostgreSQL database ??

Thanks in advance!

2 Answers 2

3

You can use PDO if your PHP has compiled and enabled with this module.
By default is included since PHP 5.1

Sign up to request clarification or add additional context in comments.

5 Comments

I tried this but seems like PostgreSQL PDO driver is also not installed. Getting this error: Fatal error: Uncaught exception 'PDOException' with message 'could not find driver' in
hmm...I guess you are stuck. No choice, you have to find a way to get postgres module or the Postgres PDO driver loaded into PHP.
common there has to be some way of doing this :(
You can however use external postgres client (meaning use bash), but that's again depend on your vendor server. If there is no postgres client, you are stuck again.
Can you tell me more about this approach?
0

Theoretically, if you can get the postgres module (.so) for this version of php and if php.ini would allow you to do so (not likely) you can dynamically load it.

2 Comments

No this is not possible. Actually there is no php.ini also on the device. Just a PHP executable.
Then it most likely doesn't even support dynamic loading. Well, I've never heard of pure-php implementation of postgres protocol.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.