Configuring PHP with GD support

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • badvoc
    New Member
    • Sep 2007
    • 44

    #31
    I think so. I am executing service httpd restart via a ssh command.

    I have found a file called vhost.conf. This has the local value for the open_basedir.

    I'll see if it can be set to no value.....

    Comment

    • badvoc
      New Member
      • Sep 2007
      • 44

      #32
      We have a result. The value now shows as / and the open_basedir restriction errors have now gone.

      I am left with

      Warning: getimagesize(/Testing/thumbs/A.gif) [[color=#0066cc]function.getima gesize[/color]]: failed to open stream: No such file or directory in /home/default/yourimage2canva s.co.uk/user/htdocs/Testing/step1.php on line 57

      I am getting other warnings of a similar nature but I feel if this one is fixed then I should be good to go.

      I have remove error reproting script that i had in my code. All errors Have no gone, or I should say are no longer visible. Am I best to leave the error reporting on and try and fix them?
      Last edited by badvoc; Sep 13 '07, 01:36 AM. Reason: More info

      Comment

      • pbmods
        Recognized Expert Expert
        • Apr 2007
        • 5821

        #33
        Heya, Badvoc.

        Try prepending $_SERVER['DOCUMENT_ROOT'] to the file path, e.g.:
        [code=php]
        $_info = getimagesize($_ SERVER['DOCUMENT_ROOT'] . '/Testing/thumbs/A.gif');
        [/code]

        Comment

        • badvoc
          New Member
          • Sep 2007
          • 44

          #34
          Forgive me for sounding thick but where do I put that line?

          $_info = getimagesize($_ SERVER['DOCUMENT_ROOT']
          $imgSize = getimagesize($s torePath);

          I have put it here and all i get now is a blank screen.

          Comment

          • pbmods
            Recognized Expert Expert
            • Apr 2007
            • 5821

            #35
            Heya, Badvoc.

            I was just putting up an example. On line 57 of step1.php, you're trying to getimagesize() on '/Testing/thumbs/A.gif' (possibly the value of a variable there), which PHP is looking for at the root level of your server's filesystem instead of the root of your website.

            Prepending $_SERVER['DOCUMENT_ROOT'] to the of the image would make PHP look for the image now in '/home/default/yourimage2canva s.co.uk/user/htdocs/Testing/thumbs/A.gif', which I suspect is where the image *really* is.

            Comment

            • badvoc
              New Member
              • Sep 2007
              • 44

              #36
              Ok, I am still a little lost but will investigate this tomorrow.

              I do have a file that that I include in step1 which defines the paths of the 2 folder variables.

              [PHP] <?php
              $storeFolder = "/Testing/uploads/";
              $workingFolder = "/Testing/thumbs/";
              define('BASE_HR EF', 'http://www.yourimage2c anvas.co.uk/');
              ?>
              [/PHP]

              Is this on the same lines as you were talking? Would this do the same job?

              The idea is that a picture is uploaded and then step1 resizes the image, stores it in another folder and is then used in a flash application as part of step2.

              Many thanks for your help its very much appreciated.

              Comment

              • pbmods
                Recognized Expert Expert
                • Apr 2007
                • 5821

                #37
                Heya, Badvoc.

                Change this:
                [code=php]
                $_info = getimagesize($_ SERVER['DOCUMENT_ROOT']
                $imgSize = getimagesize($s torePath);
                [/code]

                To this:
                [code=php]
                $imgSize = getimagesize($_ SERVER['DOCUMENT_ROOT'] . $storePath);
                [/code]

                Comment

                • badvoc
                  New Member
                  • Sep 2007
                  • 44

                  #38
                  Hi,

                  I have been working on anotherpart of the site and got the same error messages after making a change. So I undid the changes and uploaded these files to a test folder on the dedicated server and all seems good.

                  I am going to run a real test on the main url for the site this evening.

                  I think it is something to do with the paths to the upload folder, I must have had it coded slightly different and with the changes I, sorry we, were making to the server settings it seems to have sorted it.

                  I will post again later when I have tried it. If it fails I will edit with the details you have posted.

                  Many thanks.

                  Comment

                  • pbmods
                    Recognized Expert Expert
                    • Apr 2007
                    • 5821

                    #39
                    Heya, Badvoc.

                    Good luck. We'll be here if anything explodes. Unless we're what explodes. Then we won't.

                    Comment

                    • badvoc
                      New Member
                      • Sep 2007
                      • 44

                      #40
                      Hi, Well I think it is I who is going to explode.

                      I am now running the site at the following 2 urls.

                      www.yourimage2c anvas.co.uk/order.php

                      and

                      www.yourimage2c anvas.co.uk/Testing/order.php

                      The second of the is working fine. So I have ftp'd all the files to the main directory ensuring overwrite takes place and I get the following error.

                      Please ensure you have Adobe Flash Player installed. ([color=#800080]Download Flash[/color])

                      In the bottom left of the screen I have an "error on page" message. This reads as follows.

                      Line: 23
                      Char: 5
                      'Error: SWFUpload' is undefined.
                      Code:0
                      URL: http://www.yourimage2canvas.co.uk/order.php

                      the file order.php involves a browse box and a flash uploading bar. When order.php is accessed from the main url i get the error but when accessed url/Testing I get no errors.

                      Apologies for this moving slightly away from the topic but this can't be a flash issue as all other flash files are working.

                      I am very confused as to why the browse box won't load on one page but does on another.

                      Any ideas?

                      Thanks.

                      Comment

                      • pbmods
                        Recognized Expert Expert
                        • Apr 2007
                        • 5821

                        #41
                        Heya, Badvoc.

                        You probably either didn't upload the .js file that defines the SWF loader, or else (more likely) the file has incorrect permissions.

                        Locate the file and execute the following command in the shell:
                        Code:
                        chmod 755 /path/to/swf/upload/loader.js

                        Comment

                        • badvoc
                          New Member
                          • Sep 2007
                          • 44

                          #42
                          I hate to say it but the files are there and both have permissions set to 755.

                          I have even tried 777 but no good.

                          I don't understand why, when i have exactly the same files on the same server just at a sub level in the file directory, I get the error message.

                          Would it be worth deleting the whole lot from the server and re uploading it. (back ups made!!!)

                          Thanks

                          Comment

                          • badvoc
                            New Member
                            • Sep 2007
                            • 44

                            #43
                            We have a winner.

                            Sorted it. With you mentioning permssions I noticed that the permissions on the folders in the Testing folder were all 777. I have set all the folders in the main directory to the same and it works. I will now test which ones need to have those levels of permission and reset the others.

                            Many thanks for you time and help. Its very much appreciated.

                            Badvoc

                            Comment

                            • pbmods
                              Recognized Expert Expert
                              • Apr 2007
                              • 5821

                              #44
                              Heya, Badvoc.

                              Good call.

                              Good luck with your project, and if you ever need anything, post back anytime :)

                              Comment

                              • badvoc
                                New Member
                                • Sep 2007
                                • 44

                                #45
                                Thanks,

                                I have a big project coming up shortly so I'll be sure to stop by.

                                Thanks again

                                Badvoc

                                Comment

                                Working...