php.ini used by the server

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sdjl
    Senior Member
    • Mar 2004
    • 502

    #16
    Did you create a complete php.ini file? Or just a file with one directive in it?
    I've found before that using only one or directives in a file breaks other settings.

    You'll need to use a whole php.ini file and change every setting that is relevant to you.

    David
    -----
    Do you fear the obsolescence of the metanarrative apparatus of legitimation?

    Comment

    • cathode
      Member
      • Oct 2004
      • 88

      #17
      Originally posted by sdjl
      Did you create a complete php.ini file? Or just a file with one directive in it?
      I've found before that using only one or directives in a file breaks other settings.

      You'll need to use a whole php.ini file and change every setting that is relevant to you.

      David
      David, According to Andrew this will not work - and they wont give out the php.ini for security reasons.

      I just got done with two trouble tickets concerning this.


      AndrewT
      I apologize for the confusion, we use phpsuexec so you cannot place PHP settings .htaccess files. However, you can create your own php.ini in the directory of the script that requires the settings.
      -----
      (reply)
      Thanks guys... so the final word is :
      Put "php_value upload_max_filesize nM" within a file called php.ini into the script's folder?

      -----
      AndrewT
      No, you will need to use the proper php.ini syntax, that is .htaccess syntax and will not work.

      -----

      AndrewT
      You only need to set the one single setting for the upload limit, you should not copy an entire other php.ini file. But that difference would be in the value of the error reporting. Due to possible security issues we do not provide copies of our own configurations.

      -----
      (reply)
      Got it, thanks! so, if we post a php.ini file with only one variable, then that single variable will override the master properly, right?
      -----

      Andrew,

      We uploaded this into the /public_html/php/ directory (where our site code resides) and phpinfo() does show the change. However, php sessions stop working, and we use those.
      So we deleted the php.ini file and the sessions still don't work. Does php need to be restarted?

      contents of ini file:

      ; Maximum allowed size for uploaded files.
      upload_max_filesize = 6M
      -----
      AndrewT
      PHP cannot be restarted and the config changes would be reset immediatley if the file was deleted.
      And there you have it, that's as far as we've gotten.

      Comment

      • cathode
        Member
        • Oct 2004
        • 88

        #18
        I really hope that we can figure this out, I need it on multiple sites.

        Comment

        • AndrewT
          Administrator
          • Mar 2004
          • 3655

          #19
          If you only put one setting in the php.ini file, some other settings will be changed. You can put as many settings as you would like in the file, but keep in mind not all of them will work and some may create errors.

          Comment

          • cathode
            Member
            • Oct 2004
            • 88

            #20
            Originally posted by AndrewT
            If you only put one setting in the php.ini file, some other settings will be changed. You can put as many settings as you would like in the file, but keep in mind not all of them will work and some may create errors.
            Andrew,
            Is there any logic or documentation to this, any way of knowing which settings change other settings, and so on?

            Comment

            • AndrewT
              Administrator
              • Mar 2004
              • 3655

              #21
              Originally posted by cathode
              Andrew,
              Is there any logic or documentation to this, any way of knowing which settings change other settings, and so on?
              Not that I am aware of, you could try searching the cPanel forums (forums.cpanel.net).

              Comment

              • AndrewT
                Administrator
                • Mar 2004
                • 3655

                #22
                Mainly what I've seen cause problems is users that have php.ini files with ZendOptimizer settings along with other similar optimizing/encrypting agents. A base php.ini file should be fine as long as you set everything correctly.

                Comment

                • moishe
                  Junior Member
                  • Jan 2006
                  • 7

                  #23
                  First thing I did was download a php.ini template from sourceforge.
                  I changed every setting to match what phpinfo() returned.

                  The problem occured then. I heard that I only needed to change the one setting I needed changed.

                  So I uploaded the file with just
                  upload_max_filesize = 6M

                  Same problem, sessions don't work.

                  I'll try changing the session save path to something other than /tmp and see if that works. I've googled for a couple days and can find no answer so far. In my opinion if changing the one setting is hosing everything else, there ought to be an answer as to why and how to change just the one setting.

                  Comment

                  • AndrewT
                    Administrator
                    • Mar 2004
                    • 3655

                    #24
                    If you continue to have problems then you will have to compare your php.ini file with the phpinfo() output of ours when you don't have a php.ini file running.

                    Comment

                    • moishe
                      Junior Member
                      • Jan 2006
                      • 7

                      #25
                      In the following, I use the string <user> in place of the username.

                      I just tried setting the session.save_path to /home/<user>/tmp/
                      No change in session use. from this.

                      Here are the settings I had to change to make my php.ini match the server's. Note, my php.ini does not have a "Zend Optimixer" section like the server's does. I left that as is.

                      On the server's ini file this line does not exist, on my it does PHP Variables section)
                      _SERVER["HTTP_CACHE_CONTROL"] = max-age=0
                      in the same section, the _SERVER["REMOTE_PORT"] value is different 1584 vs 1547 but i doubt that would make a difference.

                      Anyways, here is what I had to change in the ini file to make mine match the server's ini file.
                      ***********************
                      error_log = error_log (was "no value")
                      error_reporting = 2039 (was "no value")
                      extension_dir = "./" (was "/usr/lib/php/extensions/no-debug-non-zts-20020429")
                      include_path = ".:/usr/lib/php:/usr/local/lib/php" (was ".:/usr/lib/php")
                      output_buffering = (was 0)
                      post_max_size = 55M (was 8M)
                      safe_mode_exec_dir = (was "/usr/local/php/bin")
                      upload_max_filesize = 10M (was "2M")
                      variables_order = EGPCS (was "no value")
                      y2k_compliance = 0 (was 1)
                      register_globals = 1 (was 0)

                      mysql.allow_persistent = 0

                      session.save_path = "/home/<user>/tmp/"
                      session.use_trans_sid = 1

                      _SERVER["HTTP_CACHE_CONTROL"] =

                      ***********************

                      I uploaded the file with these changes and sessions still do not work.

                      Comment

                      • AndrewT
                        Administrator
                        • Mar 2004
                        • 3655

                        #26
                        Please submit a trouble ticket and request that I look at it specifically.

                        Comment

                        • sdjl
                          Senior Member
                          • Mar 2004
                          • 502

                          #27
                          Do you have your tmp directory set with the correct permissions? I know this shouldn't matter so much due to suExec, but worth a look

                          David
                          -----
                          Do you fear the obsolescence of the metanarrative apparatus of legitimation?

                          Comment

                          • moishe
                            Junior Member
                            • Jan 2006
                            • 7

                            #28
                            Actually, I did try setting the tmp dir to 777.... no effect.
                            I will submit a trouble ticket.

                            Comment

                            • moishe
                              Junior Member
                              • Jan 2006
                              • 7

                              #29
                              The only thing I haven't answered yet is this:
                              if I set a session with one php file in one directory can I
                              access that same session from another php file in another directory that has it's own php.ini file?

                              If not, then this is the problem. Not sure
                              why this would be though.

                              Comment

                              • Buddha
                                Senior Member
                                • Mar 2004
                                • 825

                                #30
                                As long as they are reading the same session files that should not be a problem.
                                "Whatcha mean I shouldn't be rude to my clients?! If you want polite then there will be a substantial fee increase." - Buddha

                                Comment

                                Working...