how would i change the php.ini file?
Moderator: General Moderators
-
mikewooten
- Forum Contributor
- Posts: 169
- Joined: Wed Feb 11, 2004 12:13 pm
- Location: Duluth, Georgia
- Contact:
how would i change the php.ini file?
how would i change the php.ini file?
would i change it using the ini_set()?
if so, how would i go about changing the php.ini with the ini_set()?
what other code would i have to use with it to edit the file.
i think i need to edit or change the upload_tmp_dir to the path that i'm uploading images to.
i need that to work with my upload script that i'm using to upload images into my directory because at the moment my upload script wont uplaod images, and i think its because of the upload_tmp_dir.
if anyone can help me, that would be appreciated.
thanks
would i change it using the ini_set()?
if so, how would i go about changing the php.ini with the ini_set()?
what other code would i have to use with it to edit the file.
i think i need to edit or change the upload_tmp_dir to the path that i'm uploading images to.
i need that to work with my upload script that i'm using to upload images into my directory because at the moment my upload script wont uplaod images, and i think its because of the upload_tmp_dir.
if anyone can help me, that would be appreciated.
thanks
Edit: ?:\php\php.ini with any txt editor
or Edit ini with ini_set();
http://www.php.net/manual/en/function.ini-set.php
or Edit ini with ini_set();
Code: Select all
// example
ini_set("max_execution_time", "0");Code: Select all
can all be found on php.net
upload_max_filesize "2M" PHP_INI_SYSTEM|PHP_INI_PERDIR
file_uploads "1" PHP_INI_SYSTEM
post_max_size "8M" PHP_INI_SYSTEM|PHP_INI_PERDIR
upload_tmp_dir NULL PHP_INI_SYSTEMCode: Select all
ini_set("upload_tmp_dir", ""); // ect ....-
mikewooten
- Forum Contributor
- Posts: 169
- Joined: Wed Feb 11, 2004 12:13 pm
- Location: Duluth, Georgia
- Contact:
so the example to change the upload_tmp_dir with ini set, it would be like this?
if i wanted to change back the upload_tmp_dir to NULL after changing the directory, would it be like this?
??
thanks
Code: Select all
<?php
ini_set("upload_tmp_dir", "/home/username/public_html/folder1/p_imgs/");
?>Code: Select all
<?php
ini_set("upload_tmp_dir", "NULL");
?>thanks
In theory that should work,however i have never tried this with the upload_tmp_dir .Te best to try this out.. is make a info.php ( ini_set will only change the value for that page .. so for any other page you do not need to change the value back into NULL.
Edit: I just tried this on my php and it seems that i can not edit the upload_tmp_dir using the ini_set. I do use ini_set(); frequently with some other values i need to locally change on some pages which work fine.
windows -> edit with txt editor the c:\php\php.ini and scroll down where it says
;upload_tmp_dir =
replace it with
upload_tmp_dir = "/ure/dir/ ";
linux-> /usr/local/lib ( or where ever you installed php )
and do the same .
Code: Select all
<?
ini_set("upload_tmp_dir" , "");
phpinfo();
// than scroll down and see if it did make the nesecary changes
?>windows -> edit with txt editor the c:\php\php.ini and scroll down where it says
;upload_tmp_dir =
replace it with
upload_tmp_dir = "/ure/dir/ ";
linux-> /usr/local/lib ( or where ever you installed php )
and do the same .
some additional information which also can be found on that php.net page.
That will tell you where you can set the values or where you can modify them ( php.page / ini .. ect.. )
basicly that means..
either for you to be able to edit this with ini_set();
it would have to have be a constant PHP_INI_ALL
Code: Select all
PHP_INI_USER 1 Entry can be set in user scripts
PHP_INI_PERDIR 2 Entry can be set in php.ini, .htaccess or httpd.conf
PHP_INI_SYSTEM 4 Entry can be set in php.ini or httpd.conf
PHP_INI_ALL 7 Entry can be set anywherebasicly that means..
either for you to be able to edit this with ini_set();
it would have to have be a constant PHP_INI_ALL
-
mikewooten
- Forum Contributor
- Posts: 169
- Joined: Wed Feb 11, 2004 12:13 pm
- Location: Duluth, Georgia
- Contact:
i am using a hosting service and i am using the web hosting companies server to host all of my files. knowing that, how else would i edit the php.ini file if ini_set() wont let you edit the upload_tmp_dir?
could i make a info.php page for more than one directory?
so.. i could use ini_set() for every page and set the upload_tmp_dir to be different on every page?
thanks
could i make a info.php page for more than one directory?
so.. i could use ini_set() for every page and set the upload_tmp_dir to be different on every page?
thanks
-
mikewooten
- Forum Contributor
- Posts: 169
- Joined: Wed Feb 11, 2004 12:13 pm
- Location: Duluth, Georgia
- Contact:
-
mikewooten
- Forum Contributor
- Posts: 169
- Joined: Wed Feb 11, 2004 12:13 pm
- Location: Duluth, Georgia
- Contact:
?
??