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 -
<?php
-
include("example.php")
-
-
$num=example::myfun();
-
-
echo "$num;
-
16 4500
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
Hey Dormilich i got the root cause of the problem.
My security policy was not allowing me to create a shared library.
When i disabled it, It is working.
if you use __autoload() then you may indeed don't need it, though.
I am trying to call a C function via PHP. So will __autoload( ) does that?
I think it won't work for 2 different languages.? Or will it work?
It work's. But it was according to some specifications.So we had to take that route.
By the way, i observer strange thing. I am able to create .so file and call it in PYTHON.
Problem is coming only in PHP. Why?
Even I don't have an idea. I am searching Internet, to get a answer. But it is strange behavior.
Get an answer for what? You just said it was working.
For any others experiencing this problem, this seems to be a common problem/fix.
I am able to create a shared object and call the functions in PYTHON. But when i try to do it via PHP, I need to disable security policies of LINUX.
Why it works for one language and not for other.?
maybe the processes' groups have different rights?
May be....
But it is an interesting issue. Need to know more about it.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Jim |
last post by:
Hello,
I have a broken server that we are going to be moving off to a new server
with a new version of DB2 but here is what I have right now:...
|
by: Ken |
last post by:
Hi guys,
this is a curios thing, everything was working fine then I had to restore my
development machine( VS.NET, SQL server etc) now I'm...
|
by: Alexander Cohen |
last post by:
Hi, sometimes ill get this error:
FATAL: could not create shared memory segment: Cannot allocate memory
DETAIL: Failed system call was...
|
by: gmax2006 |
last post by:
Hi,
I am using RedHat Linux 4. and I developed an oracle 10g based
application by using cx_Oracle (cx_Oracle-4.1-10g-py23-1.i386.rpm) and
Python...
|
by: Simon Harvey |
last post by:
Hi everyone,
If anyone can help me with the following - I would be VERY grateful.
I need to deploy an 2 ASP.net applications that I've been...
|
by: Jerome |
last post by:
Hi everybody,
I need to remove access to a shared directory before to execute a
process on the directory.
And put back the access on it after...
|
by: llothar |
last post by:
Hello,
i need to manage a heap in shared memory.
Does anybody know about a portable (win32+mac+posix) c implementation
for this.
|
by: Okonita |
last post by:
Hi all,
I am having problem completing this restore operation.
"db2 restore database AAMI01 from /pap/data/backups taken at
20071002130554 to...
|
by: =?Utf-8?B?QW5kcmVhIEdhbGxhenpp?= |
last post by:
Hello,
I have a website on a NAS.
Permissions are set correctly because I can open HTML files.
When framework is involved i receive this...
|
by: concettolabs |
last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
|
by: teenabhardwaj |
last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
|
by: Kemmylinns12 |
last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
|
by: CD Tom |
last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
|
by: Naresh1 |
last post by:
What is WebLogic Admin Training?
WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
|
by: antdb |
last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine
In the overall architecture, a new "hyper-convergence" concept was...
|
by: Matthew3360 |
last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function.
Here is my code.
...
|
by: Matthew3360 |
last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
|
by: Arjunsri |
last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
| |