How do you restart php-fpm?
I need to reload my php.ini and there’s nothing in the help dialog about restarting it. Asked by Galen Assuming you have the appropriate RC scripts in place, /etc/init.d/php-fpm restart or restart php-fpm or service php-fpm restart or service php5-fpm restart Or whatever the equivalent is on your system. Edited to include suggestion from Matt Winckler. Answered by tylerl Check more discussion of this question. Bookmark on Delicious Digg this post Recommend on Facebook share [...]
Continue Reading »Install apc in production environment
Executing a pecl search apc returns the following: Package Stable/(Latest) Local APC 3.1.14 (beta) Alternative PHP Cache And according to here: http://pecl.php.net/package/APC 3.1.14 is still beta. So, should I go ahead and install that version, or stick to the latest stable version? Edit: Actually is going to go live, the server, in a day or less Asked by w0rldart If you use 3.1.14 in your development environment and everything is working as expected, I would [...]
Continue Reading »Incrementing values, alternate way of doing this that won’t use MySQL
I need to count impressions of a .php script that is accessed via web. Right now I do this in a 1 line MySQL table and just increment the value. This works fine usually but when the server has traffic bursts (hundreds of requests/second) everything gets delayed and the increment SQL statements start to pop up in MySQL’s slow queries log. I tried to count via APC but it “loses” values, that is, when I [...]
Continue Reading »Change php path
I’ve a server running Centos 5. Yesterday I upgraded php to 5.4.10 throught remi repository. Operation was successful ( I’ve checked updated information in phpinfo()) Today I figured out that php launched from shell, displays a different version (5.2.16). This version is the previous one. If I do which php output is: /usr/local/bin/php while the new php 5.4 binary is /usr/bin/php From what I understood, php was manually compiled in the system and there are [...]
Continue Reading »How do I upgrade php on openSuse?
I’m currently running openSuse 12.1 with php 5.3.8 and would like to upgrade to 5.4. How may I do this? I’m used to just installing software packages with yast. Asked by Isius If there is no package you can compile your own php 1. Download php, extract it and cd into the directory 2. ./configure – add options you need and do not forget –with-apxs2. It will compile the module for apache. (You can check [...]
Continue Reading »File readable by only PHP?
I’d like to make a file on my server be readable by PHP, but not directly accessible with a browser. Say my Apache installation’s root is /apache. I’d like PHP to be able to get the text of /apache/1.txt, but not allow the user to go to domain.tld/1.txt and view the contents. I’d still like to be able to read/write the file through FTP/SFTP without root. What would be the propper chmod string for this? [...]
Continue Reading »Running drupal as root in order for it to run bash scripts
I store a website on redhat and using drupal. There is a button on the site that activates a php script and that php script use exec to activate bash script on the server. Right now the script is not being run, i guess because of permission reason – the drupal user that runs the bash does not have root access to run the bash script. How can i add the user as a root [...]
Continue Reading »forbid custom php config settings on apache 2.2 + mod_php server
I have a server where php is running as an apache module. Every user on the server is restricted to his own directory with open_basedir. I have disabled the following functions: disable_functions = exec,passthru,shell_exec,system,proc_open,popen,curl_multi_exec,parse_ini_file,show_source Now I’d like to forbid custom php config settings, such as: memory_limit max_execution_time max_input_time post_max_size upload_max_filesize How would you go about it? ty Asked by wlf You can use the php_admin_value and php_admin_flag directives to hard code the values into your [...]
Continue Reading »SELinux: how to enable write access to Joomla cache directory?
I have set up SELinux on a Debian squeeze system, which runs a Joomla website. The Joomla PHP code wants to have write access to certain cache directories. The /var/log/messages file contains entries like these: Dec 31 10:26:16 s0022 kernel: [ 2116.423199] type=1400 audit(1356945976.634:14831): avc: denied { write } for pid=1886 comm=”apache2″ name=”_system” dev=xvda3 ino=790893 scontext=system_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:httpd_t:s0 tclass=dir Dec 31 10:26:16 s0022 kernel: [ 2116.447613] type=1400 audit(1356945976.658:14837): avc: denied { write } for pid=1886 comm=”apache2″ [...]
Continue Reading »Apache/PHP won’t allow for mod_rewrite in .htaccess files
I have a simple .htaccess file to rewrite www.domain.com/foobar.php to www.domain.com/foobar RewriteEngine On RewriteRule foobar foobar.php [L] It is giving me a 404 even though I ran phpinfo(); (which shows the mod_rewrite module), and checked httpd.conf (which uses mod_rewrite several times by default). Any suggestions? Asked by Matthew2468 The most possible reason for this is that you haven’t set ‘AllowOverride’ to at least ‘FileInfo’ at your configuration. Answered by Simon Strasser Check more discussion of [...]
Continue Reading »Recent Posts
- SCP transfer only modified files
- How can I automate clearing and resetting a Linux user’s home directory to a default?
- Cron expression that runs every 5 minutes from 1:30 am – 6:00 am [duplicate]
- Understanding redundant power supplies
- Is there a way for administrators to disable users from installing Firefox extensions?



