1
jjkaotw
SElinux execute a program in a php program
  • 2012/10/14 2:48

  • jjkaotw

  • Just popping in

  • Posts: 11

  • Since: 2012/7/29


ls -Z .
-rw-r--r--. ub book system_u:object_r:public_content_rw_t:s0 1.php
-rw-r--r--. ub book system_u:object_r:public_content_rw_t:s0 1.png

<?php
$raw_photo="1.png";
$web_photo="1n.png";
system("/bin/convert $raw_photo -resize 200 $web_photo");
?>

The php program listed above can be successfully executed on my
Fidora Linux workstation, but it fails while I execute it via. a web brower.

It should be a SElinux problem, but I have no idea how to resolve it.
It may be also the problem causing my Xoops2.5.5/news v.167 not
able to resize a png file after it is uploaded.

Please help, if you know how to resolve this problem.

jjkaotw

2
zyspec
Re: SElinux execute a program in a php program
  • 2012/10/14 22:10

  • zyspec

  • Module Developer

  • Posts: 1095

  • Since: 2004/9/21


Most installations have safe_mode enabled. You will not be allowed to execute a shell script that is not in the safe mode execution directory. A better way to do this from within PHP is to use the GD library - you can find more info athttp://php.net/manual/en/book.image.php

Login

Who's Online

141 user(s) are online (104 user(s) are browsing Support Forums)


Members: 0


Guests: 141


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits