随着help of SO community我成功运行我的第一个基于MySQL的C++文件。现在下一步是在Apache上作为CGI文件运行。在Apache它给500内部服务器错误,并在服务器日志中我得到以下几点:运行基于Netbeans的编译C++程序作为CGI给出权限错误
Sat Jan 19 12:18:18 2013] [notice] caught SIGTERM, shutting down
[Sat Jan 19 12:18:23 2013] [notice] Digest: generating secret for digest authentication ...
[Sat Jan 19 12:18:23 2013] [notice] Digest: done
[Sat Jan 19 12:18:23 2013] [notice] Apache/2.0.63 (Unix) PHP/5.3.2 DAV/2 configured -- resuming normal operations
[Sat Jan 19 12:18:51 2013] [error] [client 127.0.0.1] Premature end of script headers: addproduct.cgi
我执行以下步骤
1 - 我在用的NetBeans产生debug文件夹中去,并重新命名addproduct.o文件addProduct命令cgi的
2-在/ myappfolder/
我的文件使用MySQL的库和Boost的htdocs复制它,我想我由于同样的原因,得到错误。我愿意知道如何链接包括和libs以及CGI?
低于C++代码,并配合走来的MySQL连接器/ C++
更新:与路径摆弄之后,我现在得到以下错误:
inventory dyld: Library not loaded: libmysqlcppconn.6.dylib
Referenced from: /Applications/MAMP/htdocs/inventory/Inventory/dist/Debug/GNU-MacOSX/./inventory Reason: image not found Trace/BPT trap http://pastie.org/5723836
otool提供了以下info:
otool -LMV inventory
inventory:
libmysqlcppconn.6.dylib (compatibility version 6.0.0, current version 6.1.1)
time stamp 2 Thu Jan 1 05:00:02 1970
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)
time stamp 2 Thu Jan 1 05:00:02 1970
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.11)
这是一个原型,所以我会坚持使用普通的旧CGI。我认为你是对的,我连接错误的文件。但问题的其他部分,它将如何检测包含头文件和库文件?由于我没有制作安装程序,所以我会以某种方式将它们连接起来。 – Volatil3
从命令行运行:我得到错误* ./inventory dyld:库未加载:libmysqlcppconn.6.dylib 引用自:/ Applications/MAMP/htdocs/inventory/Inventory/dist/Debug/GNU-MacOSX /。/inventory 原因是:image not found Trace/BPT trap * – Volatil3