共享对象和php - '无法在reloc后恢复段prot:权限被拒绝' [英] Shared object and php - 'cannot restore segment prot after reloc: Permission denied'

查看:77
本文介绍了共享对象和php - '无法在reloc后恢复段prot:权限被拒绝'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个共享对象(.so)作为example.so


在我的php文件中,当我尝试调用函数myfun()时,在example.so中/>

我得到一个名字查找错误..我在php.ini中正确地给了扩展名。


我的代码是

展开 | 选择 | < span class =codeLinkonclick =WordWrap(this);> Wrap | 行号

解决方案

查找错误消失了......现在很好。但是一个新的错误。


警告:dl():无法加载动态库''。/ example.so'' - ./example.so:无法在reloc之后恢复段prot :第22行/root/example.php中的权限被拒绝


致命错误:在第4行的/root/myfile.php中调用未定义的functionmyfun()


我将这些.so文件放在/ root


和php.ini中我给了扩展名为/root/example.so。


我们可以将.so放在任何地方并在php.ini文件中给出扩展名吗?


或者我们应该放在特定的位置吗?


< blockquote>看起来你无法访问root的主目录(这是有意义的)。将文件放在具有公共访问权限的地方(如php的目录(类似于/ usr / bin或/ var或/ opt ...),否则您必须修改权限。


现在我以root身份登录。


你的许可含义是什么意思?


问候

Dheeraj乔希

i have a shared object (.so) as example.so

In my php file when i try to call a function myfun() which is in example.so

I get a name look up error.. I gave the extensions properly in php.ini..

my code is

Expand|Select|Wrap|Line Numbers

解决方案

Look up error is gone.. Its fine now. But a new error.

Warning: dl(): Unable to load dynamic library ''./example.so'' - ./example.so: cannot restore segment prot after reloc: Permission denied in /root/example.php on line 22

Fatal error: Call to undefined functionmyfun() in /root/myfile.php on line 4

I place these .so files in /root

and in php.ini i gave extension as /root/example.so.

We can place .so anywhere and give extension in php.ini file right?

Or should we place in specific locations?


it looks like you don''t have access to root''s home directory (which would make sense). place the file somewhere with public access (like php''s directory (something like /usr/bin or /var or /opt ...) otherwise you have to modify permission rights.


Right now i am logged in as root.

And your meaning of permission means?

Regards
Dheeraj Joshi


这篇关于共享对象和php - '无法在reloc后恢复段prot:权限被拒绝'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆