Note that there are some explanatory texts on larger screens.

plurals
  1. POcustom php.ini file in subfolder causing issues with $_SESSIONS variables
    primarykey
    data
    text
    <p>I have a sub-folder with two files. The first is email.php, with a form that user can send me an email. It also has a captcha-like script to prevent spam, and uses <code>$_SESSION[foo]</code> variables. The second is upload.php, which allows registered users to upload files. Both files worked fine. Now I need to increase the upload_max_filesize from the base 2MB for upload.php. My host does not provide access to main php.ini, but recommend that I create a custom php.ini file in this subfolder. So I created:</p> <p>php.ini</p> <pre><code>upload_max_filesize = 10M ; post_max_size = 10M ; </code></pre> <p>I now get the errors <code>Warning: include() [function.include]: Filename cannot be empty</code> and <code>Warning: include() [function.include]: Failed opening '' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php')</code> when I submit the form/captcha on email.php. </p> <pre><code>$_SESSION[foo]=$_GET[bar]; else $_SESSION[foo]="foobar.php"; include($_SESSION['foo']); </code></pre> <p>I found that <code>$_SESSION[foo]</code> is empty even with the <code>else</code>. After some research I found that when I ran <code>phpinfo()</code> that <code>session.save_path</code> was <code>no value</code> (the original was /tmp). So now</p> <p>php.ini</p> <pre><code>upload_max_filesize = 10M ; post_max_size = 10M ; session.save_path = /home/foobar/tmp ; </code></pre> <p>But I am still getting the error. If I remove the php.ini file from this folder, then the form script on email.php works just fine, but I am back to <code>upload_max_filesize</code> = 2MB for upload.php. Any help would be appreciated.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload