Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9068043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T17:05:40+00:00 2026-06-16T17:05:40+00:00

We have a windows master instance that writes data to Linux nodes, currently this

  • 0

We have a windows master instance that writes data to Linux nodes, currently this is working fine. The PHP files running on windows can use a simple script to write to the linux machine like so:

file_put_contents('\\\\hostname\\share\\testfile.txt', 'testing123');

The linux node has the windows php user stored, and allows the files to be written. However, we want to be able to do the same thing on the linux machines, and write to a shared folder on the windows instance. The same line as above, but with the windows host and shares, still returns true, but the file is not actually created.

  • If it didn’t work, why does the line return true? This makes it very hard to debug and test errors.
  • How can we get the script to work? Is the solution to mount the windows shares in linux? This does not seem like an appropriate solution, as we might change the windows shares or add new ones, we do not want to have to keep mounting and unmounting the shares on each linux instance.

We have added the linux user to the windows share permissions, but it does not seem to work.

Any help would be appreciated, thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T17:05:42+00:00Added an answer on June 16, 2026 at 5:05 pm

    A project that I’m working on just mounts the Windows shares. We have entries in the /etc/fstab file that mount the shares automatically when the machine is booted. For example:

    //alpha/inetpub  /mnt/alpha  cifs  credentials=/root/credentials,_netdev,file_mode=0644,dir_mode=0755,uid=1000,gid=1000,rw  0  0
    //beta/inetpub   /mnt/beta   cifs  credentials=/root/credentials,_netdev,file_mode=0644,dir_mode=0755,uid=1000,gid=1000,rw  0  0
    

    In our environment the Windows shares won’t ever change names. Our Linux instances don’t need access to all Windows shares so we just update the fstab file for whichever instance(s) need access to any new shares.

    The credentials file is a simple text file of the format:

    username=SOME_USERNAME
    password=THE_PASSWORD_FOR_USERNAME
    

    It’s just an easy way to keep a username/password pair secure when some other script/file might be viewed by users without root access.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can I have master form that will contain windows forms? Or even windows control?
I have an application that reads a set of data files and performs some
I have Windows Forms UI, that allows me to enter format for string formatting
Currently I have Windows App which is directly opening database connection (SQL Server is
I'm coming at this from the Windows world... On Windows, we have Windows Installer
I am currently working on implementing a CMS for a website. I have very
We have an Windows application that is very demanding on the customers hardware. It
I have created a data migration tool that reads data from a legacy SQL
We have a new SQL 2008 R2 instance that's part of a cluster (active/passive)
I have a local windows managed service that is trying to connect to a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.