编译php-5.5.x struct flock报错

源码编译php-5.5.1(php-5.5.0),CentOS/RedHat 5 32/64位和CentOS 6 64位都通过,唯独CentOS/RedHat 6 32位编译报如下错误:checking for known struct flock definition… configure: error: Don’t know how to define struct flock on this system, set –enable-opcache=no

google一翻看到php bug中有人提到过类似报错:https://bugs.php.net/bug.php?id=65207 不过好像没有解决,回复后,php开发组的人很快回复,他说没问题,看到他的邮箱,于是我发email给他,并附上测试主机地址,他们做事非常有原则,先用自己的测试主机测试,没有问题,于是进入我的测试主机,第一次是说测试主机没有安装 "Development tools" 。于是我 yum groupinstall "Development tools" 还是有问题。再次回邮件给他(如下图),他很快就处理,回复邮件了,编译的时候找不到有关库文件,并要我分享这个报错,已方便其他人查询。

奇怪以前怎么没有问题。可能我建立软链接方式让其找库文件不全,导致编译失败(解决方法请查看LNMP脚本中linked library部分,或查看上面图片),我偷偷记录了下他处理过程(怎么记录命令,请查看Linux初始化脚本

  1. 2013-07-21 11:37:41:root:/root/:ls
  2. 2013-07-21 11:37:48:root:/root/lnmp/:cd lnmp/
  3. 2013-07-21 11:37:48:root:/root/lnmp/:ls
  4. 2013-07-21 11:37:52:root:/root/lnmp/:reset
  5. 2013-07-21 11:37:53:root:/root/lnmp/:reset
  6. 2013-07-21 11:37:53:root:/root/lnmp/:ls
  7. 2013-07-21 11:38:02:root:/root/lnmp/src/php-5.5.1/:cd source/php-5.5.1
  8. 2013-07-21 11:38:03:root:/root/lnmp/src/php-5.5.1/:ls
  9. 2013-07-21 11:38:23:root:/root/lnmp/src/php-5.5.1/:./config.nice
  10. 2013-07-21 11:38:38:root:/root/lnmp/src/php-5.5.1/:yum groupinstall "Development tools"
  11. 2013-07-21 11:38:46:root:/root/lnmp/src/php-5.5.1/:ls
  12. 2013-07-21 11:40:44:root:/root/lnmp/src/php-5.5.1/:vi ext/opcache/config.m4
  13. 2013-07-21 11:41:28:root:/root/lnmp/src/php-5.5.1/:find /usr/include/ -type f | xargs grepn -ni "__LINUX__" | grep define
  14. 2013-07-21 11:41:38:root:/root/lnmp/src/php-5.5.1/:find /usr/include/ -type f | xargs grep -ni "__LINUX__" | grep define
  15. 2013-07-21 14:58:11:root:/root/lnmp/src/php-5.5.1/:vi ext/opcache/config.m4
  16. 2013-07-21 14:58:21:root:/root/lnmp/src/php-5.5.1/:vi tmp.c
  17. 2013-07-21 14:58:26:root:/root/lnmp/src/php-5.5.1/:gcc tmp.c
  18. 2013-07-21 14:58:36:root:/root/lnmp/src/php-5.5.1/:./a.out
  19. 2013-07-21 14:59:01:root:/root/lnmp/src/php-5.5.1/:gcc -s tmp.c
  20. 2013-07-21 14:59:03:root:/root/lnmp/src/php-5.5.1/:ls
  21. 2013-07-21 14:59:09:root:/root/lnmp/src/php-5.5.1/:ls *.s
  22. 2013-07-21 14:59:54:root:/root/lnmp/src/php-5.5.1/:vi tmp.c
  23. 2013-07-21 14:59:58:root:/root/lnmp/src/php-5.5.1/:gcc tmp.c
  24. 2013-07-21 15:00:08:root:/root/lnmp/src/php-5.5.1/:env
  25. 2013-07-21 15:00:43:root:/root/lnmp/src/php-5.5.1/:ls
  26. 2013-07-21 15:00:53:root:/root/lnmp/src/php-5.5.1/:rm a.out tmp.c
  27. 2013-07-21 15:01:22:root:/root/lnmp/src/php-5.5.1/:vi configure
  28. 2013-07-21 15:01:28:root:/root/lnmp/src/php-5.5.1/:vi configure
  29. 2013-07-21 15:01:38:root:/root/lnmp/src/php-5.5.1/:vi ext/opcache/config.m4
  30. 2013-07-21 15:02:09:root:/root/lnmp/src/php-5.5.1/:vi configure
  31. 2013-07-21 15:02:23:root:/root/lnmp/src/php-5.5.1/:vi config.log
  32. 2013-07-21 15:02:58:root:/root/lnmp/src/php-5.5.1/:env - ./config.nice
  33. 2013-07-21 15:03:28:root:/root/lnmp/src/php-5.5.1/:./config.nice
  34. 2013-07-21 15:03:41:root:/root/lnmp/src/php-5.5.1/:ls
  35. 2013-07-21 15:04:28:root:/root/lnmp/src/php-5.5.1/:vi config.guess
  36. 2013-07-21 15:04:34:root:/root/lnmp/src/php-5.5.1/:./config.gues
  37. 2013-07-21 15:04:43:root:/root/lnmp/src/php-5.5.1/:sh config.guess
  38. 2013-07-21 15:07:54:root:/root/lnmp/src/php-5.5.1/:vi config.log
  39. 2013-07-21 15:08:10:root:/root/lnmp/src/php-5.5.1/:yum install libtool-ltdl
  40. 2013-07-21 15:08:29:root:/root/lnmp/src/php-5.5.1/:rpm -ql libtool-ltdl
  41. 2013-07-21 15:08:59:root:/root/lnmp/src/php-5.5.1/:vi config.log
  42. 2013-07-21 15:10:28:root:/root/lnmp/src/php-5.5.1/:rpm -qa | grep libtool*
  43. 2013-07-21 15:10:48:root:/root/lnmp/src/php-5.5.1/:yum reinstall libtool libtool-ltdl
  44. 2013-07-21 15:11:12:root:/root/lnmp/src/php-5.5.1/:./config.nice
  45. 2013-07-21 15:18:27:root:/root/lnmp/src/php-5.5.1/:vi config.log
  46. 2013-07-21 15:18:28:root:/root/lnmp/src/php-5.5.1/:ls
  47. 2013-07-21 15:18:33:root:/root/lnmp/src/php-5.5.1/:which libtool
  48. 2013-07-21 15:18:38:root:/root/lnmp/src/php-5.5.1/:libtool
  49. 2013-07-21 15:18:44:root:/root/lnmp/src/php-5.5.1/:libtool --help
  50. 2013-07-21 15:21:11:root:/root/lnmp/src/php-5.5.1/:vi config.log
  51. 2013-07-21 15:21:15:root:/root/lnmp/src/php-5.5.1/:ldconfig
  52. 2013-07-21 15:22:10:root:/root/lnmp/src/php-5.5.1/:LD_LIBRARY_PATH=/usr/lib ./config.nice
  53. 2013-07-21 15:22:39:root:/root/lnmp/src/php-5.5.1/:vi /etc/ld.so.conf
  54. 2013-07-21 15:23:03:root:/root/lnmp/src/php-5.5.1/:vi /etc/ld.so.conf.d/kernel-2.6.32-358.0.1.el6.i686.conf /etc/ld.so.conf.d/kernel-2.6.32-358.14.1.el6.i686.conf /etc/ld.so.conf.d/mysql-i386.conf
  55. 2013-07-21 15:23:20:root:/root/lnmp/src/php-5.5.1/:file `which libtool`
  56. 2013-07-21 15:24:11:root:/root/lnmp/src/php-5.5.1/:vi config.log
  57. 2013-07-21 15:24:47:root:/root/lnmp/src/php-5.5.1/:vi tmp.c
  58. 2013-07-21 15:25:08:root:/root/lnmp/src/php-5.5.1/:vi config.log
  59. 2013-07-21 15:25:16:root:/root/lnmp/src/php-5.5.1/:cc -o conftest -I/usr/local/include -g -O2 -fvisibility=hidden -L/usr/local/lib -L/usr/local/lib -L/usr/local/mysql/lib conftest.c -lmysqlclient -lmcrypt -lltdl -lldap -llber -lfreetype -lpng -lz -ljpeg -lcurl -lz -lrt -lm -ldl -lnsl -lrt -lxml2 -lz -lm -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lssl -lcrypto -ldl -lz -lcurl -lxml2 -lz -lm -lssl -lcrypto -ldl -lz -lmysqlclient -lm -lrt -ldl
  60. 2013-07-21 15:25:27:root:/root/lnmp/src/php-5.5.1/:mv tmp.c conftest.c
  61. 2013-07-21 15:25:29:root:/root/lnmp/src/php-5.5.1/:cc -o conftest -I/usr/local/include -g -O2 -fvisibility=hidden -L/usr/local/lib -L/usr/local/lib -L/usr/local/mysql/lib conftest.c -lmysqlclient -lmcrypt -lltdl -lldap -llber -lfreetype -lpng -lz -ljpeg -lcurl -lz -lrt -lm -ldl -lnsl -lrt -lxml2 -lz -lm -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lssl -lcrypto -ldl -lz -lcurl -lxml2 -lz -lm -lssl -lcrypto -ldl -lz -lmysqlclient -lm -lrt -ldl
  62. 2013-07-21 15:25:45:root:/root/lnmp/src/php-5.5.1/:vi conftest.c
  63. 2013-07-21 15:25:47:root:/root/lnmp/src/php-5.5.1/:cc -o conftest -I/usr/local/include -g -O2 -fvisibility=hidden -L/usr/local/lib -L/usr/local/lib -L/usr/local/mysql/lib conftest.c -lmysqlclient -lmcrypt -lltdl -lldap -llber -lfreetype -lpng -lz -ljpeg -lcurl -lz -lrt -lm -ldl -lnsl -lrt -lxml2 -lz -lm -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lssl -lcrypto -ldl -lz -lcurl -lxml2 -lz -lm -lssl -lcrypto -ldl -lz -lmysqlclient -lm -lrt -ldl
  64. 2013-07-21 15:25:50:root:/root/lnmp/src/php-5.5.1/:./conftest
  65. 2013-07-21 15:25:56:root:/root/lnmp/src/php-5.5.1/:ldd conftest
  66. 2013-07-21 15:27:04:root:/root/lnmp/src/php-5.5.1/:ldd conftest
  67. 2013-07-21 15:27:19:root:/root/lnmp/src/php-5.5.1/:cc -o conftest -I/usr/local/include -g -O2 -fvisibility=hidden -L/usr/local/lib -L/usr/local/lib -L/usr/local/mysql/lib conftest.c -lmysqlclient -lmcrypt -lltdl -lldap -llber -lfreetype -lpng -lz -ljpeg -lcurl -lz -lrt -lm -ldl -lnsl -lrt -lxml2 -lz -lm -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lssl -lcrypto -ldl -lz -lcurl -lxml2 -lz -lm -lssl -lcrypto -ldl -lz -lmysqlclient -lm -lrt -ldl -L/usr/lib
  68. 2013-07-21 15:27:23:root:/root/lnmp/src/php-5.5.1/:./conftest
  69. 2013-07-21 15:28:38:root:/root/lnmp/src/php-5.5.1/:vi tmp.c
  70. 2013-07-21 15:28:59:root:/root/lnmp/src/php-5.5.1/:gcc -lltdl tmp.c
  71. 2013-07-21 15:29:02:root:/root/lnmp/src/php-5.5.1/:ldd a.out
  72. 2013-07-21 15:29:48:root:/root/lnmp/src/php-5.5.1/:ldconfig -v
  73. 2013-07-21 15:32:49:root:/root/lnmp/src/php-5.5.1/:ldconfig -v | less
  74. 2013-07-21 15:32:54:root:/root/lnmp/src/php-5.5.1/:locate libltdl
  75. 2013-07-21 15:33:32:root:/root/lnmp/src/php-5.5.1/:vi /etc/ld.so.conf.d/local.conf
  76. 2013-07-21 15:33:42:root:/root/lnmp/src/php-5.5.1/:cat /etc/ld.so.conf.d/mysql-i386.conf
  77. 2013-07-21 15:33:50:root:/root/lnmp/src/php-5.5.1/:fg
  78. 2013-07-21 15:34:08:root:/root/lnmp/src/php-5.5.1/:ldconfig -v | less
  79. 2013-07-21 15:34:08:root:/root/lnmp/src/php-5.5.1/:ldconfig -v | less
  80. 2013-07-21 15:34:39:root:/root/lnmp/src/php-5.5.1/:./config.nice
  81. 2013-07-21 15:40:07:root:/root/lnmp/src/php-5.5.1/:vi /etc/ld.so.conf.d/local.conf
  82. 2013-07-21 15:40:09:root:/root/lnmp/src/php-5.5.1/:ls
  83. 2013-07-21 15:40:21:root:/root/lnmp/src/php-5.5.1/:rm a.out tmp.c
  84. 2013-07-21 15:40:32:root:/root/lnmp/src/php-5.5.1/:ls
  85. 2013-07-21 15:40:38:root:/root/lnmp/src/php-5.5.1/:ls conftest
  86. 2013-07-21 15:41:01:root:/root/lnmp/src/php-5.5.1/:ll /usr/local/lib

Sun Jul 21 21:47:08 CST 2013

评论

目前评论:0   

点击加载更多评