Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Pro PHP
|
Pro PHP Advanced PHP coding discussions. Beginning-level questions will be redirected to the Beginning PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 13th, 2005, 06:19 AM
Registered User
 
Join Date: Apr 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Incompatibility Linux-Windows

Hi there,

i would like to know which are the risks when developing php pages under Windows and having a linux server. Which problems could i find?

Thanks in advance.

 
Old April 13th, 2005, 12:30 PM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Depends on what it is you're programming. Mostly you'll have to make file paths agree, typically this means either never using absolute paths:

e.g.
include 'C:\\www\\includes\\my_script.php';

This wouldn't be compatible if your Linux server web root is different, for example:
include '/home/www/includes/my_script.php';

instead use something like this for absolute paths:
include $_SERVER['DOCUMENT_ROOT'].'/includes/my_script.php';

Or just use relative paths:
include 'includes/my_script.php';

You'll run into other OS-specific things, but that's the biggest.

Regards,
Rich

--
[http://www.smilingsouls.net]
Mail_IMAP: A PHP/C-Client/PEAR solution for webmail
Author: Beginning CSS: Cascading Style Sheets For Web Design
 
Old April 14th, 2005, 06:21 AM
Friend of Wrox
 
Join Date: Dec 2004
Posts: 154
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Perso I use relative paths.

You can't run the PHP code from your PC anyway (or you have to install the PHP server or other apps and its a pain) - so it's faster to write the PHP code in notepad, save, ftp to your website and check it live. I use a temp directory on my server which has a stupid folder name (like 40 caracters) and has indexing turn off.

Sure it isn't the best way to do it but it works for me :)

 
Old April 19th, 2005, 06:49 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 357
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to anshul
Default

there is no much difference; i use both IIS/Apache on Windows.
$_ENV variables are usually disabled at remote host; i suggest you tally remote phpinfo() with localhost phpinfo()

about Web page editor, i say, HomeSite+ is a good one.

some functions of php depends on OS e.g., chmod() &c. so you need Apache on Linux; but this is not a critical requirement, you can do almost everything on ( local ) Windows, though Linux ( Redhat ), in itself, is a relevant ( here ) and great OS to study






Similar Threads
Thread Thread Starter Forum Replies Last Post
Remote Connection To Linux from Windows venky_vjti Linux 7 January 5th, 2015 07:37 AM
how to stop and start windows services from linux. [email protected] Linux 1 December 12th, 2006 07:53 AM
Authentication between Windows and Linux... jacob .NET Web Services 0 July 19th, 2005 05:04 PM
Connecting to MySQL from .NET on Linux and Windows jacob MySQL 1 February 5th, 2005 06:08 PM
Problem moving php from linux to windows skn8956 Beginning PHP 1 July 9th, 2004 06:21 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.