动态链接库加载出错:cannot restore segment prot after reloc: Permission denied
来源:互联网 发布:带海拔的指南针软件 编辑:程序博客网 时间:2024/04/25 13:56
作为菜鸟,几次想学LINUX的动态链接库,在网上也找了不少资源,却每次都被同一个问题挡在门外.就是在我执行程序时,总是遇到加载so文件时的错误.我按照网上说的,又是改LD_LIBRARY_PATH又是改ld.so.conf配置文件,结果都无济于事.后来找人一问,才知道原来不是它的错误,而是 Linux 内核中提供的强制访问控制 (MAC)系统SELINUX的原因.
在百度上找到了一篇文章,很好地解决了我的问题.先摘下来:
2009-02-03 22:55 When packaging an application on RHEL or CentOS, you may receive the following error:
apache2+php4整合完毕后启动apache 时报错
root@localhost fgn]# /usr/local/apache/bin/apachectl restart
httpd: Syntax error on line 53 of /usr/local/apache/conf/httpd.conf: Cannot load /usr/local/apache/modules/libphp4.so into server: /usr/local/apache/modules/libphp4.so: cannot restore segment prot after reloc: Permission denied
解决:
这是因为SELINUX的问题,需要关闭SELINX,执行:/usr/sbin/setenforce 0
引用:cannot restore segment prot after reloc: Permission denied
.
To Temporarily disable enforcement on a running system/usr/sbin/setenforce 0
To permanently disable enforcement during a system startup
change "enforcing" to "disabled" in ''/etc/selinux/config'' and reboot.
.
By default, CentOS 5 has the SE Linux feature set to "enforcing". We are looking into ways to removing these steps.
转自:http://kb.cnblogs.com/a/1393348/
- 动态链接库加载出错:cannot restore segment prot after reloc: Permission denied
- 动态链接库加载出错:cannot restore segment prot after reloc: Permission denied
- 动态库加载出错,cannot restore segment prot after reloc: Permission denied以及为何编译动态库需要-fPIC
- 动态库加载出错,cannot restore segment prot after reloc: Permission denied以及为何编译动态库需要-fPIC
- 动态库加载出错,cannot restore segment prot after reloc: Permission denied以及为何编译动态库需要-fPIC
- 动态库加载出错,cannot restore segment prot after reloc: Permission denied以及为何编译动态库需要-fPIC
- Linux下无法加载动态库问题:cannot restore segment prot after reloc: Permission denied
- 程序运行时加载动态库cannot restore segment prot after reloc: Permission denied错误解决方法
- 程序运行时加载动态库cannot restore segment prot after reloc: Permission denied错误解决方法
- linux运行程序时,出现加载动态库失败:Cannot restore segment prot after reloc: Permission denied
- Error: cannot restore segment prot after reloc: Permission denied
- cannot restore segment prot after reloc: Permission denied 解决方法
- cannot restore segment prot after reloc: Permission denied
- cent os -- cannot restore segment prot after reloc: Permission denied
- cannot restore segment prot after reloc: Permission denied
- cannot restore segment prot after reloc: Permission denied
- cannot restore segment prot after reloc: Permission denied
- cannot restore segment prot after reloc: Permission denied
- 标准C++库string及STL相关函数
- 关于序列化的问题!!!哪位大侠帮帮忙???
- 猥琐的发了一个贴
- 转帖-----我的WinCE5.0入门全过程,为了方便后来者,写了一天多,仅供大家参考!(开发环境建立+流驱动开发+相关资料)
- Android 的系统属性(SystemProperties)设置分析
- 动态链接库加载出错:cannot restore segment prot after reloc: Permission denied
- Android键盘系统相关代码分析(1)
- 二叉树的遍历 三
- 拓扑排序 C++代码实现
- 金山卫士开源了
- Alternativa3D 入门整理
- iPhone 3D游戏开发课程
- 倍增算法求解字符串的后缀数组
- Aternativa3D 7.5中的MapMapping和LOD技术