Find the answer to your Linux question:
Results 1 to 9 of 9
Hii This is deepti. Please can anyone explain this command find . -name \*.php -exec php -l '{}' \; This is used to display PHP error notices in php scripts. ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Mar 2009
    Location
    Hyderabad
    Posts
    10

    Linux Command - find


    Hii

    This is deepti.

    Please can anyone explain this command

    find . -name \*.php -exec php -l '{}' \;

    This is used to display PHP error notices in php scripts.

    Thanks.

  2. #2
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    Hi and Welcome !

    find . -name \*.php : Search files having .php extention.
    -exec php -l '{}' \; : this part do the syntax check on php files.

    Check here for option you can use with php.
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  3. #3
    Just Joined!
    Join Date
    Mar 2009
    Location
    Hyderabad
    Posts
    10
    Thank You for Quick Response.

    I have one more doubt.

    When I execute the above command in command prompt I got notices in php scripts. As I have many php scripts in the folder I have received 500+ notices but I am not able to see all the notices. can you pls say how to check/scroll all the notices. Thanks.

  4. #4
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    Direct output of find command to a file.
    Code:
    find . -name \*.php -exec php -l '{}' \;  > error_list
    less error_list
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  5. #5
    Just Joined!
    Join Date
    Mar 2009
    Location
    Hyderabad
    Posts
    10
    I did not get the above statement. Can you please explain it clearly.

    Actually my local system having windows operating system and I am connecting to linux server using putty. Here I need to execute this command(find) in this editor after getting connection from the server.

    Is there any option to check 20 messages(per enter) by using -n 20................

  6. #6
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    That command will store output of find in error_list file and you can check contents of error_list file using less command.
    Have you tried to execute both commands one by one?
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  7. #7
    Just Joined!
    Join Date
    Mar 2009
    Location
    Hyderabad
    Posts
    10
    Yes, I have executed these commands. Thanks a bunch......

    If we use find . -name \*.php -exec php -l '{}' \; >> error_list... Will the error notices appends to this file(error_list)...?

  8. #8
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    If we use find . -name \*.php -exec php -l '{}' \; >> error_list... Will the error notices appends to this file(error_list)...?
    Yes. >> appends file.
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  9. #9
    Just Joined!
    Join Date
    Mar 2009
    Location
    Hyderabad
    Posts
    10
    Thank You..

Posting Permissions

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