Hi guys,

I don't know if this is posted in the correct area, so forgive me if it isn't but I couldn't find a proper area for this.

What I would like to know is this.
I have a computer running windows 7 professional. Connected to my home hub, I have a hard drive where I store all my stuff. It is a buffallo hard drive with 1 terrabite of storage, so plenty there. I use this as a 'network' drive.

Now, with me busy playing around with php and mysql for websites, I would like to know if it is possible to use this network drive as a server to host a website that I am doing for myself. Can I designate a folder on the drive to use as a place to host from? It will need to run php and mysql.

Dani AI

Generated

Short answer: you can serve PHP files from a network (NAS) share for local development, but you should not place a MySQL data directory on that share. The replies from , and point in the same direction — the web files can live on a share if you handle Windows service/user access correctly, but database files on SMB/CIFS/NAS are fragile and slow.

Practical steps to serve PHP from the NAS

  • Install Apache/PHP locally (a dev bundle is fine).
  • Point Apache at the mapped drive letter or a UNC path. Example httpd.conf snippet:
DocumentRoot "X:/www"
<Directory "X:/www">
    Require all granted
    Options Indexes FollowSymLinks
</Directory>

If you prefer UNC, escape backslashes in the config (for example \\\\NAS\\share\\www). Important: services run under their own accounts and usually cannot see interactive users' mapped drives. Change the Apache service Log On to a user that has access to the share (Services.msc -> Apache -> Log On) or run Apache from the account that made the mapping. Ensure both share and NTFS permissions grant that account read/execute.

MySQL guidance

  • Do not put MySQL/InnoDB data files on a network share — risk of corruption and poor performance. Run MySQL on the same physical machine (recommended) or on a dedicated DB server and connect over TCP.
  • To allow remote DB connections from your web host, set the server bind address (example my.ini):
[mysqld]
bind-address = 0.0.0.0

Open port 3306 carefully and create DB users limited to the specific host.

Final notes and troubleshooting

  • For serious or public sites, use a hosted provider or VPS instead of home NAS. If Apache cannot read files, check Apache error.log, Windows Event Viewer, share permissions, and the service Log On account. For development, a local copy of the site + local MySQL gives the most reliable and fastest results.

Recommended Answers

All 4 Replies

As far as I know (my attempt failed in past) I think on network drive, you can not host apache server.

So if you have some space in your physical harddrive, there you can assing folder for hosting.

Install Apache
Install PHp
Install Mysql

All msi setups available, for windows platform, on there respetives sites.

So from an applications perspective, if you kept the website content located network drive, as long as windows has assigned this network drive a "drive letter", the web server installed on your computer should be able to use this network drive. However, it doesnt make sense to host the application on your windows server, pulling data from a network drive. the performance would be on the floor.

You can use XAMPP

It will run off anything including a USB stick !

Thanks wayneh, think I will give XAMPP a go.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.