Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> ini_get a phpinfo
Krisu
post
Post #1





Grupa: Zarejestrowani
Postów: 211
Pomógł: 0
Dołączył: 30.03.2006
Skąd: Żary

Ostrzeżenie: (0%)
-----


Witam serdecznie,
potrzebuję pobrać informację na temat aktualnie przydzielonego limitu pamięci.

Sprawdzając wartości w phpinfo(); Zarówno Local jak i Master pokazują 128M. Co jest prawdziwe, gdyż taki właśnie zapis wprowadziłem w .htaccess

Kod
php_value memory_limit 128M


Jednak gdy próbuję pobrać aktualną wartość przez

  1. <?php $memory_limit = (int) ini_get('memory_limit'); ?>


Wyświetla mi wartość 256

Przy wyższych limitach powyżej 256M, wyświetla poprawne wartości. Co jest przyczyną takiego zachowania i jak to naprawić?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
markuz
post
Post #2





Grupa: Zarejestrowani
Postów: 1 240
Pomógł: 278
Dołączył: 11.03.2008

Ostrzeżenie: (0%)
-----


Dokumetancje przeczytaj - www.php.net/ini_get
Cytat
Many ini memory size values, such as upload_max_filesize, are stored in the php.ini file in shorthand notation. ini_get() will return the exact string stored in the php.ini file and NOT its integer equivalent. Attempting normal arithmetic functions on these values will not have otherwise expected results. The example above shows one way to convert shorthand notation into bytes, much like how the PHP source does it.
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 8.10.2025 - 19:21