Which things should be thought of when designing PHP code to work on multiple platforms?
First:
* Filesystem differences. "D:\web_pub" and "/web_pub" for example.
PHP portability considerations
Moderator: General Moderators
- Heavy
- Forum Contributor
- Posts: 478
- Joined: Sun Sep 22, 2002 7:36 am
- Location: Viksjöfors, Hälsingland, Sweden
- Contact:
PHP portability considerations
Last edited by Heavy on Tue Oct 29, 2002 1:48 pm, edited 1 time in total.
- mydimension
- Moderator
- Posts: 531
- Joined: Tue Apr 23, 2002 6:00 pm
- Location: Lowell, MA USA
- Contact:
you actually don't have to worry about filesystem syntax to much. as long has you use *nix slashes, php will take care of the rest. what you would do is use realative paths everywhere and then have a single variable that holds the base path. the base bath could either be "C:/htdocs" or "/usr/htdocs". then just prepend that to all your relative paths.
- mydimension
- Moderator
- Posts: 531
- Joined: Tue Apr 23, 2002 6:00 pm
- Location: Lowell, MA USA
- Contact:
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
- Heavy
- Forum Contributor
- Posts: 478
- Joined: Sun Sep 22, 2002 7:36 am
- Location: Viksjöfors, Hälsingland, Sweden
- Contact:
So far, you are right on track.
I posted to learn about system differences, and you are teaching me!
Please go on!
I am a total newbie regarding:
Is there a concise URL I could follow to learn about those things?
I didn't check the manual right now
...
I posted to learn about system differences, and you are teaching me!
Please go on!
I am a total newbie regarding:
How are those things typically controlled from PHP and why should I consider using them?Shared Memory and semaphores for example. How about sockets?
Is there a concise URL I could follow to learn about those things?
I didn't check the manual right now
Hey,
Shared memory and semaphores are not often used in web development. That prolly accounts for why it's not often spoke of or covered in tutorials and such. As for sockets, there has been a generic implementation of sockets for some time. In the meantime, the socket functions are still considered experimental (based on the last post I read on the php mailing list).
I've used all of the above with PHP, but not in web development. These are the kinds of things that are paving the way to making PHP a pretty good general purpose language, in much the same way that Perl became such.
Now this isn't to say that the above can't be used in web development. They can. I had considered the user of shared memory for maintaing session information for example. There
are probably a good number of possibilities. It just depends on what you need to do.
Cheers,
BDKR
Shared memory and semaphores are not often used in web development. That prolly accounts for why it's not often spoke of or covered in tutorials and such. As for sockets, there has been a generic implementation of sockets for some time. In the meantime, the socket functions are still considered experimental (based on the last post I read on the php mailing list).
I've used all of the above with PHP, but not in web development. These are the kinds of things that are paving the way to making PHP a pretty good general purpose language, in much the same way that Perl became such.
Now this isn't to say that the above can't be used in web development. They can. I had considered the user of shared memory for maintaing session information for example. There
are probably a good number of possibilities. It just depends on what you need to do.
Cheers,
BDKR