Results 1 to 9 of 9

Thread: Migration from Linux to Windows

  1. #1
    Join Date
    Jan 2008
    Posts
    55
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Migration from Linux to Windows

    I have a site hosted with another company on a Linux server. It's written in PHP, and involves image uploads, however after migrating it across to a Red Fox server certain elements don't work.

    I have a couple of mods I need doing to it as well - anybody interested in having a look and giving me a price for the job?

  2. #2
    Join Date
    Mar 2005
    Location
    Isle of Man
    Posts
    1,261
    Thanks
    3
    Thanked 24 Times in 24 Posts

    Default

    I can't take on any projects, but feel free to post the errors you are encountering as I may be able to help…

  3. #3
    Join Date
    Apr 2006
    Location
    Amsterdam
    Posts
    352
    Thanks
    20
    Thanked 11 Times in 11 Posts

    Default

    I did a move a few webistes from Linux to Windows IIS. One of them contained a upload script as well and showed an error becuase of the diffrent file paths used by windows.

    I can't remember the excacte staps I took, but it was verly easy. I justed corrected the path to where the script saved the uploaded files to.
    Last edited by Rappie; 1st March 2008 at 05:53 PM.

  4. #4
    Join Date
    Jan 2008
    Posts
    55
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    On the functionality side when an image is uploaded I get this error message:

    Warning: exec() [function.exec.php]: Unable to fork [/usr/bin/convert ../uploads/original/0.jpg ../uploads/original/0.jpg.tif] in D:\wearegraduating.com\wwwroot\inc\imagemanip.php on line 91
    Looked up /usr/bin and got the following: a directory on Unix-like operating systems that contains most of the executable files (i.e., ready-to-run programs) that are not needed for booting (i.e., starting) or repairing the system.

    Got the reply from Warren:

    It seems the PHP script is using Linux's CONVERT to convert a JPG image into a TIF image - Windows doesn't natively support anything like this so there is no simple quick fix.


    It does do that - create a tif as well as a jpg - it's something that I never understood happened.. I only need a jpg, however I do want the image zipped and stored in a separate directory - it's so when it's re-downloaded a download dialog box is forced as opposed to the image opening in a browser... I have got a bit of script that will do that but haven't been able to integrate it and get it to work...

    Help would be appreciated if you can ....

  5. #5
    Join Date
    Mar 2005
    Location
    Isle of Man
    Posts
    1,261
    Thanks
    3
    Thanked 24 Times in 24 Posts

    Default

    You don't actually need to zip the file to make it download. The method I would tend to use is to push the request for the file/image through a script that reads in the real file's data and passes it out to the browser. This allows you to set headers, forcing the download, and also gives you a significant amount of flexibility for throttling and tracking downloads:
    PHP Code:
    if ($filehandle fopen($filepath'rb')) { //open binary file for reading

        
    header("Cache-Control: no-cache, must-revalidate");
        
    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); 
        
    header('Content-type: application/force-download');
        
    header('Content-Disposition: attachment; filename="' $filename '";' );
        
    header('Content-Length: ' filesize($filepath));
        
    header('Content-Transfer-Encoding: binary');

        while( !
    feof($filehandle) && connection_status()==) {
            echo 
    fread($filehandle1024*8);//send in 1kb chunks
            
    flush();
        }
        
    fclose($file);

    I've not tested that code, but I hope it demonstrates what I mean.

  6. #6
    Join Date
    Jan 2008
    Posts
    55
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    Changing the subject slightly; to download the file I have this line of code:

    <a href="/form.php?<?= $crow['gid'] .jpg; ?>"

    However the full stop is not being recognised, so the resultant link is form.php?202jpg and not form.php?202.jpg which is what I'm after - that is on the linux server....

    The way the system works is you click on a link to purchase an image giving you the result above the form processes the info and a payment box appears, you text a code to a specific number and you are given a code back. When that is place in the payment box you will then be redirected to the directory where the image is and low and behold 202.jpg appears. However you can see the image path and probably guess the way to download other images in the directory, hence the reason for forcing a download.

    I don't honestly know how would I use the code you have supplied to achieve that.

    The system does work as I have tried it with hard coded variables and manaul uploads of jpgs and zip files.

    That's improving the functionality of the site Would still like to transfer it onto Red Fox servers, but need to overcome the image upload issue. I also have applet which I have purchased - which makes file uploads easy - again tried it by hard coding in a simple scenario, but don't have a clue how to add it to the current site.

    The original developer at the company I used to design the site has moved on and I've lost faith in the current set up to come up with the goods....

  7. #7
    Join Date
    Feb 2004
    Posts
    4,903
    Thanks
    2
    Thanked 134 Times in 113 Posts

    Default

    Quote Originally Posted by UKFlyer View Post
    <a href="/form.php?<?= $crow['gid'] .jpg; ?>"
    It should be:

    PHP Code:
    <a href="/form.php?<?=$crow['gid'] . '.jpg'?>"
    Warren Ashcroft
    Red Fox UK Limited - Pioneers in Internet Technology
    http://www.redfoxuk.com
    w.ashcroft [at] redfoxuk.com

    NOTE: Forum Private Messaging should not be used to contact staff with support queries.

  8. #8
    Join Date
    Mar 2005
    Location
    Isle of Man
    Posts
    1,261
    Thanks
    3
    Thanked 24 Times in 24 Posts

    Default

    PHP Code:
    <a href="/form.php?<?= $crow['gid'] . '.jpg'?>"
    [edit]as Warren has said[/edit]

    Is the way you need to write that bit.

    The snippet I gave looks like it would go somewhere in that form.php script. By the sound of it, the program already works in the way I had been describing.

    You are welcome to PM me any URL and/or FTP details etc. and I'll have a quick look. I'm on the road most of the next few days however so may be a little slow at responding.
    Last edited by nick; 2nd March 2008 at 06:32 PM. Reason: To slow at posting

  9. #9
    Join Date
    Jan 2008
    Posts
    55
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Mod_rewrite

    The script I have uses mod_rewrite to create virtual directories on a linux server. Will enabling URL rewriting produce the same result (a previous post states that URL rewriting works in the same way) - I'm assuming an element of code modification would be required...?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Pc to Apple migration...
    By creativeworks in forum MSSQL
    Replies: 5
    Last Post: 19th October 2007, 07:47 AM
  2. Reseller on Linux or Windows?
    By Ian in forum Sales and Service Feature Enquiries
    Replies: 12
    Last Post: 10th January 2006, 08:31 AM
  3. .Net 2.0 + SQL 2005 migration
    By ninjalabs in forum Sales and Service Feature Enquiries
    Replies: 17
    Last Post: 11th October 2005, 07:59 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •