Coding For Windows To Upload To Linux
I'm trying to remember what code I had that would work on a Linux server but not on my apache php mysql install on a Windows machine.
Does anyone know of instances of this? Someone I know doesn't believe that this is the case because they believe that php is truly cross platform. I realize that for most code it does work on Windows and Linux but I think there are exceptions that need to be noted.
View Complete Forum Thread with Replies
Related Forum Messages:
Linux Or Windows
i am an experienced php programmer with almost a dozen sites to my credit, of late i've gotten onto 'c' programming on Linux and also a little bit of GUI coding using GTK+... as we all know, microsoft is in the process of releasing its .NET software, having a look at these white papers will make even the most hardcore linux enthusiast sit up and take notice..man....they are coming out with good products..... Combine this with the ease with which one may generate apps in VB..god will microsoft win finally ?? I mean that whats the scope left for Linux programmers if Microsoft is the next big thing in internet computinfg ??? also are there any Linux companies that will be able to combat this juggernaut ?? Please giv me valuable comments...is it an unwise thing to get into Linux programming when VB and VC++ would be a better option ?? Lets all not be gung-hoin our love for linux...but lets ask ourselves whats the better option ??? Well...i luv linux too but if Windows could earn me bucket loads of money...why not switch to that ??
View Replies !
Windows PHP VS LINUX PHP ?
My code works fine on linux, but if i switched to windows, it messes up. I see some error messages, all msgs have something to do with undefined constant. I use Apace 1.3.14, php 4.0.6 loaded as module, and I think my mysql is 3.22.21, I'm not quiet sure. Running WindowsME.
View Replies !
Windows Or Linux
I'm getting a host soon, and I'm wondering if it makes a huge difference, if at all, to develop on one OS or the other. Right now I'm using Windows XP but my computer is partitioned and I can use Linux.
View Replies !
Windows To Linux
I developed my php codes in windows based wamp, and now I was told to move to linux server. I think php by itself should not be a problem, but what about handling files is it the same as for windows. Like c:parentlablaimage.jpg.
View Replies !
Difference Between PHP On Windows And Linux
I just got promoted at work from sales to web developer. We have a ton of projects planned including a new CRM from which a lot of our internal tools will be based. My boss despises Microsoft and we primarily use Corel Office products including Paradox for our current CRM. He's been developing in it for years and can make it dance. However, it is straining under the current load and it is clear that its life expectancy is quickly coming to an end. We will be phasing that out as we build web-based tools but it will be around for a while in some capacity as our migration away from it will be a gradual one. For a while I'm sure the two will be used in tandom as we continue to develop our infrastructure and transfer functionality from it to a new CRM. I will be developing in PHP/MySQL. I also will be using some Perl for cron jobs and other tasks. There will be a lot client-side programming (shouldn't be a factor for this discussion) but all of the apps we have planned will be database driven and there will be over 1 million records (probably closer to 1.25 million) when we actually deploy our tools. Anyway, I was debating which platform I should use to build our tools on as my boss prefers Windows as he is completely Linux clueless. However, I have only ever developed on Linux/Unix platforms. Whatever I chose now will affect everything I build from here on out so I want to make the right choice the first time. So my questions are as follows: 1) What are the main differences running PHP (and MySQL for that matter) on Windows versus Linux? Any benefits or pitfalls? Missing functionality? 2) Should I install Apache or use IIS? 3) Our CRM will be generating a ton of documents which will need to be printed. Is this easier on Windows or Linux? I've heard that a lot of developers use Crystal Reports to generate documents. We do have Version 9 if that matters (although I am aware it only works on Windows). I also have little idea how printing is done so any input on that would be wonderful. 4) What would you chose and why?
View Replies !
Includes On Linux And Windows
I have a program that performs an include("/home/xyz/includes/common.php"); I do this so the include file (which contains database login information) is outside of the web root directory and (hopefully) invisible to anyone who might get into the website. On my home PC running XP and Apache, my PHP.ini include_path is set to ".;d:xamppincludes" and under this directory I have the directories "homexyzincludes". This worked fine when running on my old system using PHP 4.2.2. I recently upgraded to the latest version of Xampp running PHP 5.0.5 and I now cannot access the include files on my XP system. If I change the include to remove the leading "/", it works fine - but will not work on Linux. I understand that this used to work on older version of Win32 PHP but has been changed. Is there a way to issue an include that will work on both Linux and XP under the more recent versions of PHP?
View Replies !
Windows Server To Linux
I have the code below which worked fine when I was using it on my windows server. However I had a few problem with the windows server then I had to switch to a Linux based server. Once the switch was completed I started having problems with a number of my codes which worked fine previously. I have managed to solve quiet a few of them with the exeption of this one which I cant figure out and was hoping you could help. Code:
View Replies !
How To Run Windows .exe In Linux Environment
My problem is, as stated, how i want to run a windows .exe in Linux Environment? I has a task, which require to use a windows .exe to generate a result file, and until now, i has success on generate the result file (i do it on windows XP environment using command prompt). Now, i want to embed this functionality (i.e generate result file) into my website. I am using php, and i think there should be no problem if the environment is Windows Server 2003 or others windows server environment (just using exec() provided in php will work, correct me if i am wrong). But unfortunately, i am using Linux as OS environment. Code:
View Replies !
Specifying Paths In Linux/Windows
I develop my scripts on a Windows platform but run the webs on a Linux server. I'm new to PHP and admit that I get in an awful mess when trying to specify paths in general scripts that might be called by pages in various folders. I would like to use a configuration file in each script that will extract/set the root path for the site, depending upon whether it is on the Windows platform or on Linux.
View Replies !
Portability Of From Windows To Linux
I am new to the open source environment. We have to develop a web application using Apache/PHP/MySQL on Windows (A component that we want to use is available only on Windows for now). Later when the component is available on Linux, we would like to move the code. The web application is a simple one - collects data, does some simple validations and stores in the database. I would like to know how portable the code will be. Do we need to rewrite a lot of code when we move from Windows to Linux? What are the issues I need to be aware of?
View Replies !
Windows ODBC From Linux
I want to connect to an ODBC data source on a Windows XP machine from PHP on a Linux machine (over a LAN). I assume I need to do: Code: $odb = odbc_connect("ODBCDSN", "name", "passwd") ; I don't know what format to code that ODBCDSN in order to refer to a resource on another host on the network.
View Replies !
Case Sensitive Linux And Windows.
I have 2 php setup, one 'live' and one windows for testing. But as you no windows is not case sensitive, whereas Linux is. Is there a way, (apart from switching to Linux), that i could set windows to be a bit more strict? Sometimes when developing i forget and only realize when i run the install.
View Replies !
Scripting In Linux, Development In Windows...
This isn't really a major question but I wanted someone else's view on this. I do web developement and find it a lot easier to do the designing part (colors, graphics, layout) on a windows box and to do my scripting (php,MySql) on my linux box. Now, this can be rather annoying due to booting every time I want to create a new layout since my primary OS is linux. Well, I just wanted to see what other people had to say about this.
View Replies !
Apache,MySql,PHP On Windows Vs. Linux
Crazy (possibly dumb) question here... I have a site running apache, mysql, php in a Win2K environment. Primary development is that env also. I also am setting up a linux box (old laptop), to begin playing with Linux. I'd like to set it up similiary with apache,mysql, php. If I do that, and start doing some development there (Linux box) - can I expect that when I move the php code to the windows box that it will behave similarly as it did on Linux? Anything to watch out for? I'm completely new to Linux...
View Replies !
Migration From Linux -> Windows And Errors
I moved a php script of mine over to a windows machine and im getting the following errors after the move: Notice: Undefined index: op in C:Nanoson SitesPersonalised Promotionspersonal.co.zaouwewerflogin.php on line 6 Anyone know what might cause this?
View Replies !
Windows PHP Connect Into LINUX Server
I want to built a windows php website---> connect to the linux box--->read all settings value from the .ini files->display it into the php website->user can then change the values->save the .ini file base on the user modification close the file-->for back up reason of settings, also save the values into SQL database. I also need to reboot the linux box after apply changes to the .ini. Anyone knows how to approach this problem? What do I need? Does php have a built in ssh?
View Replies !
Windows / Linux MySQL Script Issues
My scripts work fine on my linux box at work, but when I move em home, they still work fine but at the top of every page i get this message Warning: Cannot send session cookie - headers already sent by (output started at c:apachehtdocs ussell ealestate es_det.php:6) in c:apachehtdocs ussell ealestate es_det.php on line 9 Warning: Cannot send session cache limiter - headers already sent (output started at c:apachehtdocs ussell ealestate es_det.php:6) in c:apachehtdocs ussell ealestate es_det.php on line 9 Is there something you have to change/add in PHP scripts working with a MySQL db in windows?
View Replies !
Com Ports Windows Machines With Linux Served PHP
I built a nifty code set that took a reading from a scanner and fed it into a database... this worked great, until I found the server was Linux (Ubuntu) and the code I was using would not co-operate on that. Is there any way to open the browser and click a button, having the local machine access it's com port 1 and read data from the device connected before feeding that back to the central database?
View Replies !
Remote Linux Commands From A Windows PHP Server
I'm running a Windows webserver and I would like to use PHP to connect to my linux box (non-webserver), send it commands (change directory, run commands, create files, etc) and files, and be able to get files back that it created on the linux box. The linux machine has ssh/sftp (with password) access, so is there a way for me to connect through ssh without installing extension libraries and run commands etc? I've searched through the forums and haven't found anything that is my particular situation.
View Replies !
Compile Oracle Support On Linux For Windows
I'm trying to help a local non-profit organization tie in their online credit card donations to their existing vendor software, which uses Oracle 8i (8.1.7) on windows. Does anyone have any pointers on 1) how to compile oracle support into PHP, not having a linux version of Oracle, and 2) creating remote connections to Oracle.
View Replies !
Timestamp Insert Issue: Windows / Linux
The DBMS can optimise for COUNT(*) in ways that it can't for COUNT(<field>) - it doesn't need to look at any fields, for example (and so uses fewer resources). If my table has a field named id that is primary and auto incrementing in MySQL, it is still better to use COUNT(*) instead of COUNT(id)? Do you also believe this is true when using SELECT (SELECT * instead of SELECT id, name)?
View Replies !
Capturing A Display On Remote (linux) Server From (windows) Web Browser
I've a utility that runs on a linux machine. Basically, it opens a window, draws a figure and captures the image (screen) and stores it as a jpeg file. The utility requires a window to be open (or displayed) inorder to save the image. Also, this utility is in the form of an executable, so I can't possibly alter it. I want to run this utility from a windows web browser and display the saved jpeg file. I pass some command line parameters to change the figure it draws. The php code I use is as below: Code:
View Replies !
Image Upload - Resize Using Linux
I've got an image upload script, which resizes the image using the Linux image commands. What baffles me is that if a upload an image, it works okay, and then if a upload another image, I get the following error: Warning: unlink(): No such file or directory in /path/to/image on line 167 I can't figure out why its doing this? Code: if ($REQUEST_METHOD == "POST") { /*== upload directory where the file will be stored relative to where script is run ==*/ $uploaddir = "/path/to/images/_images"; /*== get file extension (fn at bottom of script) ==*/ /*== checks to see if image file, if not do not allow upload ==*/ $pext = getFileExtension($imgfile_name); $pext = strtolower($pext); if (($pext!= "jpg") && ($pext!= "jpeg")) { print "<h1>ERROR</h1>Image Extension Unknown.<br>"; print "<p>Please upload only a JPEG image with the extension .jpg or .jpeg ONLY<br><br>"; print "The file you uploaded had the following extension: $pext</p>"; /*== delete uploaded file ==*/ unlink($imgfile); exit(); } //-- RE-SIZING UPLOADED IMAGE /*== only resize if the image is larger than 250 x 200 ==*/ $imgsize = GetImageSize($imgfile); /*== check size 0=width, 1=height ==*/ if (($imgsize[0] > 250) ¦¦ ($imgsize[1] > 200)) { #echo $imgsize[0].'<br>' #echo $imgsize[1].'<br>' /*== temp image file -- use "tempnam()" to generate the temp file name. This is done so if multiple people access the script at once they won't ruin each other's temp file ==*/ $tmpimg = tempnam("/tmp", "MKUP"); /*== RESIZE PROCESS 1. decompress jpeg image to pnm file (a raw image type) 2. scale pnm image 3. compress pnm file to jpeg image ==*/ /*== Step 1: djpeg decompresses jpeg to pnm ==*/ system("djpeg $imgfile >$tmpimg"); /*== Steps 2&3: scale image using pnmscale and then pipe into cjpeg to output jpeg file ==*/ system("pnmscale -xy 250 200 $tmpimg ¦ cjpeg -smoo 10 -qual 50 >$imgfile"); /*== remove temp image ==*/ unlink($tmpimg); } /*== setup final file location and name ==*/ /*== change spaces to underscores in filename ==*/ $final_filename = str_replace(" ", "_", $imgfile_name); $newfile = $uploaddir . "/$final_filename"; /*== do extra security check to prevent malicious abuse==*/ if (is_uploaded_file($imgfile)) { /*== move file to proper directory ==*/ if (!copy($imgfile,"$newfile")) { /*== if an error occurs the file could not be written, read or possibly does not exist ==*/ print "Error Uploading File."; exit(); } } /*== delete the temporary uploaded file ==*/ // THIS IS WHERE IT FLAGS THE ERROR unlink($imgfile); print("<img src="path/to/image$final_filename">"); /*== DO WHATEVER ELSE YOU WANT SUCH AS INSERT DATA INTO A DATABASE ==*/ } ?> <form action="<?=$SCRIPT_NAME;?>" method="POST" enctype="multipart/form-data"> <input type="hidden" name="MAX_FILE_SIZE" value="50000"> <p>Upload Image: <input type="file" name="imgfile"><br> <font size="1">Click browse to upload a local file</font><br> <br> <input type="submit" value="Upload Image"> </form>
View Replies !
File Upload Not Showing Up In /tmp Linux
I'm having huge problems with a web server not putting the uploaded file in the /tmp here is my code can some one please point me in the right direction?I'm thinking i've done something with wrong with apache but can't find out what. ---- up.html ---- <HTML><BODY> <FORM method="POST" enctype="multipart/form-data" action="./up.php"> <input type="hidden" name="MAX_FILE_SIZE" value="1000000000"> <input type=file name=fupload> <INPUT type="submit"> </FORM> </BODY> </HTML> ---- up.html ---- ---- up.php ---- <HTML><BODY> <?php echo "main hi $fupload<BR>"; if( isset($fupload)){ echo "isset found hi $fupload_name<BR>"; } ?> </BODY> </HTML> ---- up.html ---- ---- output from a file uploaded of 120k---- <HTML><BODY> main hi <BR></BODY> </HTML> ---- output ----
View Replies !
Photo Upload - Wont Work On Linux Server
I have this code, works perfectly on Windows server, but now i'm trying to run it on a Linux server, the form submits, i get no errors, but the photo doesnt upload, and the caption file doesnt write.... any ideas why? <?php include 'gall_settings.inc' //check if the directory exist or not. if (!is_dir("$upload_dir")) { die ("The directory <b>($upload_dir)</b> doesn't exist"); } //check if the directory is writable. if (!is_writeable("$upload_dir")){ die ("The directory <b>($upload_dir)</b> is NOT writable, Please Chmod (777)"); } //Check first if a file has been selected //is_filetoupload_file('filename') returns true if //a file was filetoupload via HTTP POST. Returns false otherwise. if (is_uploaded_file($_FILES['filetoupload']['tmp_name'])) { //Get the Size of the File $size = $_FILES['filetoupload']['size']; //Make sure that $size is less than 1MB (1000000 bytes) if ($size > $size_bytes) { echo "<b>Error!</b><br>"; echo "File Too Large. Please try again."; include ('gall_footer.php'); exit();
View Replies !
PHP Upload In Windows
I have php and apache running in Windows XP. I am trying to use various file upload scripts but none of them work. When I try to use ones that use a copy function I get the following error: Warning: copy(C:serverxitamiwebpageshivangPhotoGallery empimg3e710f87bf1ed.jpg) [function.copy]: failed to create stream: No such file or directory in C:serverxitamiwebpagesshivangPhotoGallery est.php on line 46 File could not be stored. Anther script I tried does the following: // Open the uploaded file $file = fopen($img1, "r"); // Read in the uploaded file $fileContents = fread($file, filesize($img1)); // Escape special characters in the file $fileContents = AddSlashes($fileContents); The above script fileContents only has half the image. I have the upload_tmp_dir set to c:serverupload and file_uploads to yes.
View Replies !
Max Upload On Windows
I have an upload script for my client. The max upload in the php.ini is set to 2M..as standard. I tested it on a linux server and by editing the .htaccess file I can increase the max upload filesize. That doesn't work on the windows server. So i tried this <input type="hidden" name="upload_max_filesize" value="16000" /> and this <input type="hidden" name="upload_max_filesize" value="16M" /> and this <input type="hidden" name="post_max_size" value="16M" /> <input type="hidden" name="upload_max_filesize" value="16M" /> <input type="hidden" name="max_execution_time" value="600" /> I can't get anything to work. Is there a set way to increase the max upload on a windows server?
View Replies !
PHP Pages Display In All Windows Browsers And NO Linux Browsers!
OS: Windows XP, Windows 2000 OS: Linux Red Hat Enterprise Level 3, Fedora Core 3 Browsers: Firefox 1.0, IE 6.1+, Mozilla, Konqueror We are working on an internal website that is to be used as an intranet. This page goes through an initial SSL layer after asking for certificate acceptance, once you acccept the page should pull up. And here is the problem: It pulls up under any browser within Windows; it never pulls up under any browser within Linux. This includes Firefox; it's fine in Windows/Firefox but locks up cold in Linux/Firefox.
View Replies !
PHP 5 Windows File Upload
I need to define a loaction for file for uploads. I am using Win server 2003 PHP 5. I have edited my php.ini to define a location for uploads. upload_tmp_dir=/somedir/somesubdir/ I restarted my server and I still get no value for upload_tmp_dir. Any ideas what's wrong?
View Replies !
File Upload On Windows
This is really the first time I have ever had to work with PHP on Windows. I seem to be running into a problem I never have on linux. The following code show the correct directory in which the image should be moved to, but it fails. It shows the correct path and is_uploaded_file is a success. Code:
View Replies !
File Upload Mac Os X Fine, Windows Xp Not ?
I've written a simple CMS (the file upload is handled by code I found here) for a site I'm working on and I thought everything was working ok until I tested it on a pc. I always get the same error on the pc which is something I wrote so that only normal jpg's would be uploaded, not progressive jpgs (this is because the site has a flash front end and flash can't load in progressive jpg's dynamically). I added some more error checking in the php file, and a very strange thing is occuring. I have tried uploading the EXACT same jpg from both my mac and pc, on the mac it uploads fine, resizes etc etc but on the pc it doesn't and in my error message it says that the file is a 'image/pjpeg'? Does a pc think a normal jpg is a prgressive jpg ??? How can the jpg change file types? this is really weird!
View Replies !
Upload Script On Windows Not Working
I am trying to write an upload script that will upload files to a certain directory. I am testing this on my windows desktop under apache if it makes a difference. Part of the target path is what the user posts to create a new directory for the uploaded file to be put into: Code:
View Replies !
Need To Detect Windows Vs Mac Files Upon User Upload
We have a need to ensure a user is uploading an acceptable file format (image artwork). The company only supports Windows and would like to know if it's possible to discern between Windows and Mac. Then let the user know the file was acceptable or not. Is file platform detection possible with PHP?
View Replies !
PHP Exec() And Zipping Upload File In Windows
I have the following code. What I need is to zip the file (c:webuploadsomeFile) to d:websomeFile.zip. $cmd = 'c:zipzip.exe '. $movedFile. ' '. $finalFile; exec( $cmd, $cmd_output ); File is being uploaded by the apache server, but it's not being zipped. My guess "", escaping, is causing problem in windows path. Do I also have to escape the $movedFile content? Forexample $movedFile= "c:webuploadsomeFile".
View Replies !
"Windows & Linux"
When I look at php_info(), it tells me I'm on a Linux system, but I am actually on windows. I also can't find the php.ini from the path displayed because I'm on windows. Any ideas?
View Replies !
Upload Script: Failed To Open Stream: Permission Denied In Windows NT
i've put an upload script on my site, hosted on a Windows NT Version 5.0 server. When i try to upload something i get an error: copy(files/file.txt): failed to open stream: Permission denied in d:sitesmatita.bewebsiteuploaded.php on line 20 Could not copy The problem is that i am not able to change the permissions, since it's a windows server. CHMOD is not supportes, CACLS neither. Is there a way out, or is it up to the server admin to install some 'permission system'?
View Replies !
Pre-coding
I need some advice on feasability etc on using PHP (MySQL backend) for a little project that I have in my mind. I'm new to PHP, but not programming (thank God!) - so barring syntax, logic should be fine (I hope), but I'm unsure if PHP has the ability to do what I need (told you I was a newbie eh?? ) The project .... Simply put, the idea is for a series of drop down boxes to kinda act as a "filter"for data in the records in a mysql db. Ie, lets say for example that my db contains info about cars, with the columns, Make, Model, CC, Colour etc etc. Initially the user would see (in the above example), 4 drop down boxes, each with data pulled from the db relevant to their column id. The pulling of data I dont have a problem with - thats sorted. However, in the brief coding exercises I've done, its the ability to have a user choose any of the four drop boxes, and all the other 3 dropdown boxes data be ammended ? Am I explaining this well ? Lets say that I choose 'Red' from the Colour drop down - then the drop down box for Make should change to only be Makes where colour = red, Model should also change to where colour = red etc etc etc ? With me here ? At any point the user will have the ability to 'go' their selection - and all the records are displayed for the user. Am I wanting too much here from PHP? I've been told JScript would do what I need (better than PHP?????) but frankly I dont have the time to start learning another lang, so if this can be done in PHP I'd be happy.
View Replies !
SSL Coding
how difficult/easy is it to implement credit card transactions onto a webpage in terms of the coding that is needed to send details to a merchant etc? is the core coding such as forms for credit card number the same, its just encrypted once it has been processed?
View Replies !
With Coding
I have need for a simple system in a Virtual Airline in which users can file flight reports. I use Whole Hog's free password protection. When filing the report the users will have to be logged in. They will file their pilot ID and time of flight and a few other bits and pieces like from where to where and extra notes. I need something to save each one to a database, maybe MySQL. Then there is a roster page, which then displays how many hours each pilot has. What I want to happen is for when the pilot files the report, the hours are added to what he has already. In the pilots page, I would then like there to be a box showing recent flights. I was wondering if anyone could give some script to me?
View Replies !
PHP 5 Coding
Just installed php5 and Mysql 5 and now my site is just showing a lot of code so I am assuming that my php is not configured correctly. What I would like to know is how would I know what to tweak to make things work. Here is the url to my site.
View Replies !
|