debian

How can I run a linux command from a PHP script [duplicate]

牧云@^-^@ 提交于 2019-12-18 04:52:32
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: php shell_exec() vs exec() How do I run a linux command from a PHP script? I'm running Linux Debian and PHP5. I want to be able to issue a wget command to the console. An example of what I'm looking for is something like this: phpFunction ("wget http://www.example.com/image.jpg /folder"); echo "done"; Also would I be able to echo the output of that function? 回答1: Use exec to run any command. Be careful not to

Your PHP MySQL library version differs from your MySQL server version

余生颓废 提交于 2019-12-18 04:39:14
问题 I've recently upgraded MySQL on my Debian 5.0.4 server to 5.1. Now phpMyAdmin shows the following warning: Your PHP MySQL library version 5.0.51a differs from your MySQL server version 5.1.43 Is it likely to cause any problems? 回答1: The message indicates that : You are using version 5.1.43 of MySQL server But that the library that's used by PHP to communicate with that server has been compiled to communicate with a version 5.0.x of MySQL. In theory, this should not cause any real problem :

dpkg: How to use trigger?

最后都变了- 提交于 2019-12-18 04:34:23
问题 I have written a little cdn server that shall rebuild his pool registry if new stuff (pool-content-packages) is installed into the pool. Instead that every pool-content-package call the init.d of the cdn-server, I'd like to use triggers. Than it would restarted the server only one time at end of an installation run after all packages are installed. What have I to do to use trigger in my packages with debhelper support? 回答1: What you are looking for is dpkg-triggers. One solution with use of

Docker daemon flags ignored

﹥>﹥吖頭↗ 提交于 2019-12-17 21:54:06
问题 Environment: OS : debian 8.0.0-amd64, ubuntu-15.04, 16.04 Docker : 1.x.x Procedure: I changed /etc/default/docker to add a private docker registry, then I restarted docker service and finally tried to pull some image. $ cat /etc/default/docker DOCKER_OPTS="--insecure-registry mydocker-registry.net:5000" $ service docker restart $ docker pull mydocker-registry.net:5000/testdb FATA[0000] Error: v1 ping attempt failed with error: Get https://mydocker- registry.net:5000/v1/_ping: dial tcp: lookup

Git clone fails with out of memory error - “fatal: out of memory, malloc failed (tried to allocate 905574791 bytes) / fatal: index-pack failed”

烂漫一生 提交于 2019-12-17 18:39:56
问题 I'm attempting to clone a large (1.4GB) Git repository to a 32-bit Debian VM with 384MB of RAM. I'm using Git 1.7.2.5, and using the SSH protocol to clone ('git clone user@host.com:/my/repo') The clone fails with this message: remote: Counting objects: 18797, done. remote: warning: subobtimal pack - out of memory remote: Compressing objects: 100% (10363/10363), done. fatal: out of memory, malloc failed (tried to allocate 905574791 bytes) fatal: index-pack failed I've tried reducing the amount

Debian Squeeze AMD64安装Oracle 10g x86_64 10.2.0....

試著忘記壹切 提交于 2019-12-17 17:59:47
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 服务器操作系统为Debian Squeeze AMD64,没有安装X,通过ssh远程访问。客户端为debian testing,安装有gnome桌面环境。 先安装10.2.0.1,然后安装升级包10.2.0.4,比安装10g r2客户端多了一些操作,具体安装过程如下: 一、安装10.2.0.1 1、下载oracle 10g r2 下载回来的文件为10201_database_linux_x86_64.cpio.gz $gunzip 10201_database_linux_x86_64.cpio.gz $cpio -idmv < 10201_database_linux_x86_64.cpio 解压缩后所有的安装文件位于database目录下。 2、检查硬件是否达到要求 物理RAM必须大于512M,现在的机器内存都没问题。超过8GB RAM时,swap应该在物理RAM的0.75倍以上。Enterprise Edition安装类型大约使用2G硬盘空间。 通过以下命令检查,如果不满足需要做相应的调整 $grep MemTotal /proc/meminfo //检查物理内存大小 $grep SwapTotal /proc/meminfo //检查swap大小 $df -h //检查可用硬件空间大小 3

Optimize PDF files (with Ghostscript or other)

扶醉桌前 提交于 2019-12-17 15:03:55
问题 Is Ghostscript the best option if you want to optimize a PDF file and reduce the file size? I need to store alot of PDF files and therefore I need to optimize and reduce the file size as much as possible Does anyone have any experience with Ghostscript and/or other? command line exec('gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -sOutputFile='.$file_new.' '.$file); 回答1: If you looking for a Free (as in 'libre') Software, Ghostscript is surely your best

Whats the difference between sed -E and sed -e

扶醉桌前 提交于 2019-12-17 09:46:49
问题 I'm working on some old code and I found that I used to use sed -E 's/findText/replaceWith/g' #findText would contain a regex but I now try sed -e 's/findText/replaceWith/g' It seems to do the same thing, or does it? I kinda remember there being a reason I done it but I can't remember and doing "man sed" doesn't help as they don't have anything about -E only -e that doesn't make much sense ether. -e, --expression=script Append the editing commands in script to the end of the editing command

Call Python script from bash with argument

℡╲_俬逩灬. 提交于 2019-12-17 07:05:22
问题 I know that I can run a python script from my bash script using the following: python python_script.py But what about if I wanted to pass a variable / argument to my python script from my bash script. How can I do that? Basically bash will work out a filename and then python will upload it, but I need to send the filename from bash to python when I call it. 回答1: To execute a python script in a bash script you need to call the same command that you would within a terminal. For instance >

Call Python script from bash with argument

风流意气都作罢 提交于 2019-12-17 07:05:21
问题 I know that I can run a python script from my bash script using the following: python python_script.py But what about if I wanted to pass a variable / argument to my python script from my bash script. How can I do that? Basically bash will work out a filename and then python will upload it, but I need to send the filename from bash to python when I call it. 回答1: To execute a python script in a bash script you need to call the same command that you would within a terminal. For instance >