Tag Info

New answers tagged

1

Why not use top -bd 5 -n 3 -p `pidof init` >> /home/test/nik/myscriptoutput2 instead of your whole script... In PHP you can use <?php $file = "/home/test/nik/myscriptoutput2"; $output = shell_exec('top -bd 5 -n 3 -p `pidof init`'); file_put_contents($file, $output); ?>


1

php.ini has a directive has been named disable_functions , For example: disable_functions = ...


1

If you have a GNU find you can use -printf option find `php-config --extension-dir` -name "*.so" -printf 'extension=%f\n'


2

How about this? find "`php-config --extension-dir`" -name "*.so" | sed 's!^.*/!extension=!' For each line, sed will match the longest string that starts at the beginning (^) and ends at /. It will always match everything up to and including the last /, because it is a greedy match, i.e., it will match everything but the filename. It then replaces that ...


0

I've changed the following configuration file /etc/postfix/sasl/smtpd.conf pwcheck_method: saslauthd mech_list: PLAIN LOGIN This now allows authentication to work correctly.


1

If you give a PHP script to someone there is no way you can limit its use, since the person can modify the script as he wishes before putting it into the server. And if you give it to him encrypted, it won't be usable. What you can do is to host your PHP script on your server and allow the person to call it remotely from his script. However, I'm not sure ...


0

If you are missing some files, you need to make sure you have the module that provides it installed in your system. Under Ubuntu, if you type apxs on a terminal, it will provide you with suggestions. Different paths are possible for apache installation. They may differ by Linux distribution you are using. For example, you can find configuration under ...


1

While your question actually confused me, I believe you should move away from using a php script to handle the snmptrapd service. That file (/etc/snmp/snmptrapd.conf), is used by the snmptrapd service which can be enabled at whatever run level you wish (3, 4, 5) and can be configured to log traps to MySQL, so there is no need to create a separate daemon. ...


1

Try to specify the full path: zend_extension = /full/path/to/ioncube_loader_lin_5.4.so I don't know from when is this change, but one was used to always specify full path for zend_extension until a build of PHP 5.5 (on Fedora, but I think it's the same on Debian). I think it's a maintainer choice.


0

You can use setsebool httpd_can_network_connect=1


0

Another option: Create an .htaccess file in your web server root with the following: AddType application/x-httpd-php .htm .html Now apache will process .htm and .html files as php documents and any <?php ... ?> tags located in that file will be interpreted as php.


0

I gather the best solution is to end the php with: header('Location: index.html'); exit;


1

I suppose you could use readfile to dump the file you've just created towards the browser. Alternatively, you could issue a 302 temporary redirect to index.html.


1

It was a simple syntax issue. vim /etc/php.ini ; Maximum amount of memory a script may consume (128MB) ; http://www.php.net/manual/en/ini.core.php#ini.memory-limit memory_limit = 1536 The problem was with the line I had changed. memory_limit = 1536M If you don't specify the suffix indicating the memory allocation, it does memory ...


2

According to the documentation on PHP exec(): If the output argument is present, then the specified array will be filled with every line of output from the command. Does your version of at declare the job number? $ echo /bin/true | at now + 1hour job 1 at Fri Apr 24 12:00:00 2015 If so, you might then use explode() with a space delimiter to get the ...


1

Lets add some Debugging Info, like so: $f = fopen('mmascript.m', 'w'); echo "fopen complete." fwrite($f, "#!/Applications/mma/Contents/MacOS/MathematicaScript -script\n"); echo "fwrite 1 complete." fwrite($f, 'Print[100]'); echo "fwrite 2 complete. fclose($f); echo "close complete." chmod('mmascript.m', 0777); echo "Permissions Successfully Changed." ...



Top 50 recent answers are included