SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Sep 2011
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unable to create file using PHP

    Hi all

    I have written a PHP program which will run a C program using 'system' command. As per my intention, my C program will create a file which the PHP will read(to get the output of C as the output is a string).

    If i run my C program alone in terminal, it is creating a file with the desired content in it. But when i use PHP to run the C program, it is not creating the file. When i checked by removing the file part in the C program, the PHP is running the C program correctly (checked using printf). But when i add file part to the C program, nothing is working....C pgm is not printing anything.

    My main returns a value 0. But in the PHP system command, it prints return value as 139.
    What may the reason for this? Please suggest me few ways to overcome this.

  2. #2
    SitePoint Enthusiast
    Join Date
    Jun 2008
    Posts
    49
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello harsha2624,

    try to post some of your code here.

    Jake


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •