Tag Info

New answers tagged

0

Did you check the audit logs? I suspect SELinux is preventing your web server from opening up outbound connections to an FTP server. You might need to set the httpd_can_network_connect boolean. Check the audit logs by running (as root, or through sudo): ausearch -m avc -ts recent after attempting to load the web page. You can set the SELinux boolean with ...


1

I have not used PHP, but I've used FastCGI to accomplish a similar thing with other lanaguages, and that's the approach I'd recommend, especially since php 5.3.3 and newer has an implementation built in, PHP-FPM. You can find documentation on how to use this on the official PHP website: FastCGI Process Manager (FPM). This has many features, but the most ...


1

What about that dollar sign in front of cmd, as in $cmd = Is the dollar sign a typo? (Sorry for not making this a comment -- no reputation points.)


-1

You can't. Apache runs under a low-privilege account — typically called apache or httpd — on purpose. The only way Apache could be configured as you propose is if it ran as root, which would make Apache a massive security risk. You will have to use the OS's suid bit bit feature to get the effect you want. You don't say which OS you're using; it matters. ...


0

You can check for the process using ps, but one drawback is that if you have multiple instances of this process running or if the script is hung up then this method can be less than conclusive. I prefer to actually check if the server is listening on the port. Here are a couple of ways to do this. If your server is listening on port 2000 for example ...


0

not sure this solve your XY problem if ps -C php -o args h | grep -q server.php then true ## php server.php running else php server.php ## not running fi ps -C php will seach for php instance, -o args will display full command line, h without header grep -q be quiet This will check wether php server.php is running, if programm is stop process ...


2

This is, at least in part, governed by the ServerTokens directive, so you could set ServerTokens Prod which will reveal only that the Server is an unspecified version of Apache, but even the manual itself suggests this is not a security measure.


0

The easiest way to record a script's exit conditions is to make it record them. #!/bin/sh trap 'date +" My name is $0. My PID is $$. My start time was '"$(date)."' The time is now %X on %x. My exit code is $?. Goodbye. " >/tell/somebody' EXIT : now do some stuff An EXIT trap should work in every exit scenario but one which is ...


0

This seems to call for at/batch since you are using a web front end. The results can either be emailed to the user or a que which gets poled by the user (using client side javascript or just plain user based checking).


1

You'll need to get rid of the intermediary shell and start it as your direct child, probably with something like proc_open (I'm no PHP expert). Then you'll get a SIGCHLD when the child terminates. You can install a signal handler for it (pcntl_signal most likely) and in it nonblockingly (WNOHANG) wait (pcntl_waitpid ) on your child's PID and if the wait ...


0

Drop down menu in html is a select. <form method="post" action=""> <select name="something"> <option value="2014">year 2014</option> <option value="2015">year 2015</option> </select> <input type="submit" name="submit" /> </form> Then after submit $something = ...


0

When installed, MySQL doesn't start by default, you have to start it. service mysqld start then run the security sudo mysql_secure_installation also see : https://github.com/dnschneid/crouton/wiki/Running-servers-in-crouton


0

Oh finally, I had a NULL feedback, cause of sudo only for terminal (tty). deactivted it for my user. It works a charm now. $ visudo #in sudoers : Defaults:myusername !requiretty


1

Ok I figured It out I needed to run pkg install php56-[missng module name]-5.6.9 For each of the above modules (in fact hash came with one of the others) I also ran pkg install OpenSSL but I'm not sure if I needed to go that or not.


4

That will depend on what the command is doing. However, you could automate it by adding this line to your ~/.profile: source /opt/rh/php54/enable That will run the source command each time you log in. There is probably a better way of doing this, presumably the enable script is just setting some variables that you could set directly but this should work ...


0

What you want is a daemon, not a cron job. A cron job is for executing something periodically (or at boot), not for keeping a process alive. I encourage you to read that article, then do something very simple like this: #!/bin/sh while true do /my/script.php >> /var/log/my_script.log 2>&1 done



Top 50 recent answers are included