top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration
Print Preview

How to enable the chroot() function in PHP 5.4?

0 votes

It was easy in PHP 5.3 as long as you were building the CLI by itself. In the PHP 5.4 configure script there is a new PHP_BINARIES variable being used instead of setting PHP_SAPI=cli and thus the "#define ENABLE_CHROOT_FUNC 1" is never written to the output file. I have been able to manually enable it by adding the define to the main/php_config.h after running configure. The issue seems to be a line: if test
"program" = "program". This comparison being true is what causes the configure script to add "cli" to the PHP_BINARIES variable instead of setting the PHP_SAPI variable. The other prerequisites (HAVE_CHROOT and ZTS) are all at the required settings. It is only the ENABLE_CHROOT_FUNC which is causing the function to not be compiled into the resulting binary. Any information or explanation would be very helpful.

For the record, I know what the chroot() function does and does not do. I am experimenting with using chroot() to isolate an already running script to a particular subset of the filesystem for file operations.

posted Jun 13, 2013 by anonymous

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button Google+ Share Button LinkedIn Share Button Multiple Social Share Button

Similar Questions
+1 vote

I've two machines set up with Apache2.4 and PHP5.4.15 and I'm trying to debug owncloud as it has problems with Apache2.4. This autoloader and routing 'fun' seems totally over the top, and is failing without giving any errors, but the question is "what limits the amount of text displayed using print_r() ?" Where I drop in a print statement causes crashes, but when working I'm not getting a complete printout. One machine is clipping at around 4500 characters, while the other is managing around 9000, and neither is displaying the 'TAG' labels after that block.

It's not something I've seen before ... I've been using this method for many years and normally see all the text. So can anybody throw light on why this may be happening now? Interestingly the two machines are giving different problems with this application which works correctly on Apache 2.2

+2 votes

Is it possible to use PHP 5.2.5 with Apache/2.4.6?

I have an application that was written in WAMP5 using PHP 5.2.5, and I am trying to get the application onto a CentOS server and I can't get it to work with 5.4.16.

Are there any good tutorials on using an older version of PHP with Apache?

0 votes

I recently migrated my webserver from Debian Lenny (with PHP 4.x) to Wheezy with PHP 5.4.

Some applications like mediawiki could be updated and they are running fine.

But there are some old and beloved applications that run any more. A good example is PHPmyedit 5.7.1 The first page with data is displayed but all links and buttons are dead!

There is no error produced by PHP and i have no idea why it is not working? I'm have only basic knowledge with PHP and would be glad to have some tips how to debug things without error.

My hope is that this migration problem is known and can be fixed simply?

0 votes

I just upgraded Squeeze to Wheezy, and have difficulties with cURL PHP extension: I can't enable it.

I have installed following packages related to this issue: curl, libcurl3, libcurl3-gnutls, php5-curl.

I have in /etc/php5/mods-available/curl.ini

; configuration for php CURL module
; priority=20

I know that cURL extension is not enabled because I want to install Moodle and it complains about cURL extension. How can I solve this problem?

+3 votes

I'm getting a disparity in results when setting safe_mode in php 5.6.7.

This is what I have set in my php.ini file:

$ grep safe_mode /etc/php.ini | grep -i -v -e gid -e
exec -e allowed -e sql -e protected -e include

safe_mode = Off

Yet when I grep the output of php -i I only see sql_safe_mode:

$ php -i | grep safe_mode
sql.safe_mode => Off => Off

Any ideas on this?

Useful Links with Similar Problem
Contact Us
+91 9880187415
#470/147, 3rd Floor, 5th Main,
HSR Layout Sector 7,
Bangalore - 560102,
Karnataka INDIA.