Jump to content

loading php file on another computer


gple

Recommended Posts

I am running php on one computer at work and want other users on other computers to access the index page by sharing it.after mapping the page, I see no data on the other machine. Does php, as pache need to beer installed on other computers footer it too work properly

Link to comment
Share on other sites

Let me add something.

 

I am running php on one computer at work and want other users on other computers to access the index page by sharing it.after mapping the page, I see no data on the other machine.

It's correct behavior because of security reason. You may have some secret information inside you PHP page, for example login-password for access to DB. It's not a good idea to send it to another server.

 

Let me assume that you use Apache as web-server. You may say Apache to don't process PHP file but send them like a text. In such a case you may use your scripts at another servers. But you'll have a very big hole in your site's security. Also you are not able to use (process) script at a "root" server 'on one computer at work'.

 

Do you still like to let other servers to use you PHP files in the same way like your server do? :)

Link to comment
Share on other sites

ok, if its correct behavior, how do i get around this. We have purposely created an internal mysql database and have built a website for security purposes. We want to share the index page to a couple of other users within the small business. Again, one computer has php, apache and mysql installed. the entire website was created on a local machine and is functioning properly. When I map to that folder from another machine and try to load the page, then I get zero data. I was thinking that I may have needed either apache or php installed on that second computer but I didnt see the code display on the webpage.

Link to comment
Share on other sites

I'm a little unsure what you mean by "share" and "map" it. Are you trying to directly access the PHP file in a network folder?

 

You need to browse to the file in a web browser, with the server's IP or domain. Like http://1.2.3.4/script.php

 

If you only want to allow certain people from viewing it you could use Apache's mod_access for that. To do that you need to create an .htaccess file in the docroot of your server with this code:

Order Deny,Allow
Deny from all
Allow from 1.1.1.1 2.2.2.2 3.3.3.3

 

Change the IP's to the ones you want to view the website, separated by spaces.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.