Board index   FAQ   Search  
Register  Login
Board index PHP PHP Installation

How to load PHP extensions?

Forum for you who has PHP installation issues

Moderators: macek, egami, gesf

How to load PHP extensions?

Postby terence83 » Thu Jul 28, 2011 2:18 am

Hi,
I did some coding in PHP before but I came across a problem I don't know how to solve it:
I have a Website which has PHP installed (5.1) but by default none of the PHP extensions are loaded. In the instructions it says I need to load any extension I need dynamically in my script using dl(). This of course leads to the situation that if I try to look at my uploaded PHP file I get an error message.
Sorry for my naiv question: But how do I know which extensions I need to load??
I tried some test code but it didn't work:

<?php
// Example loading an extension based on OS
if (!extension_loaded('sqlite')) {
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
dl('php_sqlite.dll');
} else {
dl('sqlite.so');
}
}

// Or, the PHP_SHLIB_SUFFIX constant is available as of PHP 4.3.0
if (!extension_loaded('sqlite')) {
$prefix = (PHP_SHLIB_SUFFIX === 'dll') ? 'php_' : '';
dl($prefix . 'sqlite.' . PHP_SHLIB_SUFFIX);
}
?>

Can anyone help me with this? that would be great!
thanks.

PS: I usually have php running on my laptop in the default installation - my files run without a problem...
terence83
New php-forum User
New php-forum User
 
Posts: 1
Joined: Thu Jul 28, 2011 1:32 am

Return to PHP Installation

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron