title: Extension PHP with C. Creating the first environment I got awk syntax error using ext_skel
body: <p>Extension PHP with C. Creating the first environment I got awk syntax error using ext_skel</p>
  
  <p>The error's above:</p>
  
  <pre><code>enter code here
  awk: syntax error at source line 256 source file /Users/Princelo/Downloads/php-5.5.14/ext/skeleton/create_stubs
   context is
                           if (!stubs) print "" &gt; extname &gt;&gt;&gt;  "/function_warning" &lt;&lt;&lt;
  awk: illegal statement at source line 257 source file /Users/Princelo/Downloads/php-5.5.14/ext/skeleton/create_stubs
  awk: syntax error at source line 267 source file /Users/Princelo/Downloads/php-5.5.14/ext/skeleton/create_stubs
  rm: function_entries: No such file or directory
  rm: function_declarations: No such file or directory
  rm: function_stubs: No such file or directory
  enter code here
  </code></pre>
  
  <p>It generated myextension.c which doesn't have the function "PHP_FUNCTION(myextension)".
  How to fix the problem? My OS is Yosemite, PHP version 5.5.14. Thanks!</p>
  
  <p>the source of create_stubs from line 251 to end:</p>
  
  <pre><code>    enter code here
          print proto &gt; stubfile
          if (funcvals) print funcvals &gt; stubfile
          if (fetchargs) print fetchargs &gt; stubfile
          if (resources) {
                  print resources &gt; stubfile
                  if (!stubs) print "" &gt; extname "/function_warning"
          }
          if (!i_know_what_to_do_shut_up_i_dont_need_your_help_mode) {
              print "\tphp_error(E_WARNING, \"" funcs[i] ": not yet implemented\");" &gt; stubfile
          }
          print "}\n/* }}} */\n" &gt; stubfile
  
          if (stubs) {
              h_stubs = h_stubs "PHP_FUNCTION(" funcs[i] ");\n"
              c_stubs = c_stubs "\tPHP_FE(" funcs[i] ",\tNULL)\n"
          } else {
              print "PHP_FUNCTION(" funcs[i] ");" &gt; extname "/function_declarations"
              print "\tPHP_FE(" funcs[i] ",\tNULL)" &gt; extname "/function_entries"
          }
  
          if (xml) print xmlstr &gt; xmldoc
      }
  
      if (stubs) {
          print "\n/* ----------------------------------------------------------- */\n" &gt; stubfile
          print c_stubs &gt; stubfile
          print "\n/* ----------------------------------------------------------- */\n" &gt; stubfile
          print h_stubs &gt; stubfile
      }
  
      if (xml) print xmlfoot &gt; xmldoc
  }
  
  #
  # Local variables:
  # tab-width: 2
  # c-basic-offset: 2
  # End:
  
  enter code here
  </code></pre>