Jump to content

PECL, does PHP 5 come standared with it?


Demonic

Recommended Posts

That's the PEAR library right?

You can just install it in your directory (if it's not available already, on the server) and then use ini_set("include_path", <path here>) to set the path to the PEAR directory.

 

Might be worth outputting ini_get("include_path") to see what you have already.

Link to comment
Share on other sites

See here.

 

Funny, I found that link by clicking the first Documentation link in the page you linked to.

 

hehe real funny right?  Show me where you can upload to your server and use the extensions.(I'm not an idiot thats the first place I looked, trying to be witty right?)

Link to comment
Share on other sites

If you want to upload an extension to your server you can either simply download the extension from pecl (it is simply a repository), compile it locally and then upload the *.so file to your server.

 

Or, do all this (same steps as above) from your server.

 

You do realise that pecl extensions need to be compiled? And that you would normally need root access to the server to be able to install them?

Link to comment
Share on other sites

OK, we'll get some stuff straight. Extensions are written in C. The mysql extension is one such extension, GD another. Allot of these come bundled within php's source code, others are made available via the PECL repo.

 

Compiling an extension is pretty simple... especially on linux. Once the extensions has been compiled however you then need to place the *.so file within php's extension directory. This is usually located within the /usr/lib directory somewhere and is owned by root.

 

If your using (standard) shared hosting you would need to conact your host and ask them if they could install the extension for you. Some, shared hosts ive heard however allow you to use your own custom environment and thus also allow for your own extesnions to be built. You will normally have shell access to these types of accounts.

 

Sorry, but I don't have allot of experience with shared hosting, I run my own servers.

Link to comment
Share on other sites

Firstly, as of php5, dl() has been depricated within web envirnments. It should only be available within the cli.

 

But yeah, dl() dynamically loads extensions by name. The extensions need to be within your extensions directory. You would use this to dynamically load extensions which haven't been defined with your php configuration.

Link to comment
Share on other sites

In the manual.

 

The way it works is...

 

Within the php.ini is a directive called extension_dir, here you can list the directory where all dynamically loadable extensions reside. The php.ini file is loaded once when the server starts, so this directory cannot be changed on a per user basis.

 

I have however (as I said earlier) heard of some shared hosting giving you your own environment. I think this is done using php as cgi instead of the normal module way.

 

Do you have access to your own php.ini on the hosting you use? If so... (I'm not 100% sure/don't use shared hosting), you may actually be able to define your own extension_dir.

Link to comment
Share on other sites

OH, and ps. Just because dl() has been depricated it can still be used if turned on within the php.ini. There is however probably good reason it has been made depricated.

 

You'll need to find these reasons yourself as I'm not sure what they are.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.