meotimdihia
meotimdihia

Reputation: 4299

Why can I not use "ini_get()" or "ini_get_all()"?

I use ini_get('tmp_dir') but it returns false. I found out I can't use ini_get() and ini_get_all() on server. Why can I not use it?

Upvotes: 1

Views: 337

Answers (4)

Pekka
Pekka

Reputation: 449613

Most likely, as others already say, the hosting provider is blocking scripts from calling the ini_get() function for security reasons.

In this case, however, I would not use the system's temporary directory at all. Chances are that your script can't write or read there either, also for security reasons.

If you need to create temporary files, best use a directory inside your user directory (but outside the web root).

Upvotes: 1

esycat
esycat

Reputation: 1364

It can be disabled by disable_functions directive, which is quite usually the case on virtual hosting services for security reasons.

Upvotes: 0

Colin Hebert
Colin Hebert

Reputation: 93177

It might be a limitation of your hosting service. You should try to contact them.

Upvotes: 1

Haim Evgi
Haim Evgi

Reputation: 125574

use this function:

sys_get_temp_dir

Returns the path of the directory PHP stores temporary files in by default

Upvotes: 0

Related Questions