1

I'm going to buy a (cheap) hosting space with apache/php 5/mysql. Because it's cheap i have no direct control over php.ini and extension loading.

My question is: can i load an extension putting the .dll file into my space and than using dl() php function? Can the host disable this feature thus avoid loading custom extension this way?

2
  • If the extension_loaded() function works as I assume it does from reading the docs, you could attempt to load the extension using dl() and then check that it has become available using if (!extension_loaded([EXTENSION])) { echo "Failed to load extension"; exit(); } and then you'll be able to prevent your code working if it doesn't load. Just an aside. Commented Oct 7, 2011 at 15:30
  • Gremo, take a look at alwaysdata.com/plans/shared They have a free plan which you can start out on, and then if you need the traffic, I'm sure their cheapest plan won't be a problem. They have been very accommodating to me. For a far less flexible option, but cheaper and very stable servers, try 1and1.com/?affiliate_id=328546 Commented Oct 7, 2011 at 15:52

3 Answers 3

2

Yes, it can be disabled through the enable_dl and safe_mode php.ini settings (which would almost certainly be the case, as otherwise you could e.g. load your own code in the web server process).

And that's in addition to the disable_functions setting, which can disable anything.

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

1 Comment

Not exactly true that you can disable anything, for instance you can't disable eval, sadly, because it's one of the worst and dangerous features of PHP. This is because eval is a language construct, not a function.
0

the host can disable any function within php from the php.ini. in fact I would be surprised if the host left this feature on.

Comments

0

Since you're talking about a .dll, you are assuming to get a Windows hosting server running PHP, however, is better that you check with the hosting company, because probably dl() will be disabled.

Smaller hosting companies can be more accommodating with adding extensions you may require.

Comments

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.