New answers tagged

0

I ran into this issue trying to get PHP extensions involved in a Docker container. Here is what I had to do: apt-get install libldb-dev libldap2-dev ln -s /usr/lib/x86_64-linux-gnu/libldap.so /usr/lib/libldap.so \ && ln -s /usr/lib/x86_64-linux-gnu/liblber.so /usr/lib/liblber.so


0

Yes, suPHP is a powerful PHP tool developed to execute PHP scripts, allowing to set up and correct permissions and ownership of your files and folders as a script owner with complete protection on web servers and building accessibility.


0

Not exactly what you need, but take a look on the issue: move domain alias


0

That htaccess file seems to be trying to find any URLs with index.php, and rewrites them to have index.php in (remember you rewrite FROM what the person sees TO how the application needs it (i.e. has index.php in). I would try it without the first condition. The Hosting support is a red herring, if the server throws a 500 (i.e. too many redirects caused ...


0

I replaced the following block: location ^~ /app/api { alias /var/www/appwarded/app/api/public; try_files $uri $uri/ @api; } With: location ^~ /app/api { alias /var/www/appwarded/app/api/public; try_files $uri $uri/ @api; location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass ...


0

My money is on "configuration" – but probably in the opposite way you anticipate... I suspect you've configured it too much. It looks to me as if you've been "tuning" your server's performance right into the ground. If you have been using a "tuning" script – stop doing that. For example... table_definition_cache=6000 and table_open_cache=6000 ...


1

Fist, increasing the prefork parameters will only worsen your situation. So restore the previous configuration. To rule out any prefork problem/misconfiguration, try to disable it. Does the situation change significantly? If so, you find your problem. If not, the problem is related to external factors: for example, maybe some bot/script is targeting your ...


1

PHP Version 5.6.20 debian and based: su aptitude install libldb-dev ln -s /usr/lib/x86_64-linux-gnu/libldap.so /usr/lib/libldap.so then, try to compile it


-1

With the native install of php7.0, no compilation is needed. The directory to the config for php7 is /etc/php/7.0/cli i search the same file for apache2 and not find (again) See you later :-)


0

The error message tells you exactly what the problem is. Do you have the following line commented out in your config perhaps? LoadModule unique_id_module modules/mod_unique_id.so You may need to recompile Apache if you did not compile it with the --enable-unique-id flag (most distributions have it included in compiled version though possibly commented ...


2

There is a way to achieve this on a per-directory basis. You do find contradicting opinions on the web, but I have been able to make it work. First, you must organize to have your different versions of PHP ready to run as CGI or fastCGI extentions. I use fastCGI in the example below You will need to set up two separate php.ini files (and yes, maintaining ...


0

From your question it looks like PHP process gets hung during the interaction with MySQL. I would suggest enabling slow queries and trace the time taking queries.


1

When you use the nginx real ip module, nginx places the actual connecting IP address in the $realip_remote_addr variable when it does the IP address substitution. So you can pass this to your application by setting the header: fastcgi_param CF-Proxy-IP $realip_remote_addr; This variable requires nginx 1.9.7 or later.


4

I may be wrong, but I believe that sudoers also restricts parameters that can be passed to a command/script, not just the command itself. If you try to run your .sh without the parameter it will likely work e.g. sudo /bin/bash /var/www/my_bash_script.sh So, to tell sudoers to allow that script to be run with any parameters (by apache), you would need ...


0

You can use the following settings Cmnd_Alias SVNUP = /root/webhooks/svn_update.sh apache ALL=(ALL) NOPASSWD: SVNUP Create simple test script # cat test.sh #!/bin/bash set -u echo "Param1: $1" Make simple tests $ id alex uid=506(alex) gid=506(alex) groups=506(alex) $ cat /root/webhooks/test.sh cat: /root/webhooks/test.sh: Permission denied $ sudo ...


0

Reading error messages is hard: sudo: /etc/sudoers.d is world writable You have incorrect permissions on the /etc/sudoers.d directory. That directory should not be world writeable (if you allow that (and sudo would accept it) then any user can grant themselves sudo privileges, which is a Bad ThingTM) Fix that! [sudo] password for daemon: Hmmm. Your ...


0

You have to start apache with that environment variable set. Setting the variable in /etc/profile.d/php.sh only sets it for the PHP executable itself, which is not used by mod_php5. I just went through this rigamarole. Setting the variable with SetEnv won't work, either, as it's defined after mod_php5 is loaded. In CentOS 6.5, I found that editing ...


0

One way is to have Nginx try to access Wordpress first, but then to try Laravel next if it doesn't hit, using try_files. This is how I do it when I have Cake PHP on the root of the domain and Wordpress in the /blog directory. There are probably downsides to this approach, but it works fine on my sites - low volume. location / { try_files $uri $uri/ ...


1

You specified Type=forking but the program you started never forked within the timeout period, so systemd considered that it hadn't started up properly, killed it, and marked the service as failed. Are you sure that your process daemonizes itself? It would be quite unusual for a PHP script to do this. Perhaps you should be using Type=simple instead.


0

It's been a while, but from what I remember, and what it sounds like you need to do is - at the beginning of your script check to see if the headers have been sent and send them if not. That's assuming you aren't using the WordPress API and just rolling your own script that is being called for some reason.


0

There are several versions of IONCUBE(4.1-5.6). Yes you might have it installed properly, but if it's not 5.2 being referenced in the php.ini, your app is not going to work. I personally had to insert: zend_extension = /usr/local/ioncube/ioncube_loader_lin_5.6.so into: /etc/php5/apache2/php.ini /etc/php5/cgi/php.ini /etc/php5/cli/php.ini - this would be ...


0

The default config of Ubuntu is that PHP does not expire sessions but there is a cron job which deletes old files. A full discussion of this would take some time (IMHO, it's a very bad idea) however I'm not aware of Redhat taking a similar approach. You have not provided any details of your session config. This situation can arise due to the values for any ...


1

sudo find /var/lib/php/session -type f -delete will work better than sudo rm /var/lib/php/session/* because expansion of * is hardly possible for big lists of files.


1

You need to ask some questions about your current Apache configuration before you can begin troubleshooting the performance: What worker process are you using in Apache? Pre-fork or MPM(threaded)? Are these workers configured correctly in your apache.conf? What happens if you change some of the values? (does performance increase when you add more idle ...


1

It sounds like your application is creating sessions but never destroying them. This could be poor programming and a mix of bad environment settings. If you want to remove those session files you need to use sudo as they're likely not owned by your user. sudo rm /var/lib/php/session/* I would not remove the entire session directory. Another thing is ...


0

Looks like the culprit was OOM-KILLER due to no-swap-left, evidence was left in /var/log/messages Apr 17 05:29:31 Centos-PHP56 kernel: php invoked oom-killer: gfp_mask=0x280da, order=0, oom_adj=0, oom_score_adj=0


0

If the apache is failing to respond after one or two days means it is a performance issue, consider increasing the worker process and servver process instances. Some basic example below, tweak it as per your needs to resolve the issue. ServerLimit 16 StartServers 2 MaxRequestWorkers 150 MinSpareThreads 25 MaxSpareThreads 75 ...


0

See the mysql bug that could be applied to you. Apparently you can get rid of this error limiting the "table_open_cache" configuration to a higher number (500)


0

In Apache 2.4 under Ubuntu 14.04, the default deflate.conf file contains: AddOutputFilterByType DEFLATE text/css and AddOutputFilterByType DEFLATE application/x-javascript application/javascript application/ecmascript which add the gzip compression. This is different than using a "minifier" program, which basically rewrites text files by getting rid ...


0

php7.0-dev is not in the trusty repositories (see here), so it stands to reason that some/many of its dependencies won't be in that repository, either. Easy answer Upgrade to 16.04 LTS xenial when it is officially released next week April 21, 2016. It has php7.0-dev and all of its dependencies. See here. Hard answer You may be able to manually install ...


0

Per AskUbuntu, try dpkg --get-selections | grep hold. If there are any packages listed, remove them. If that doesn't work, try apt-get autoremove


1

Finally found another piece of the solution while using PHP 7.x. Hope this helps someone else. Thanks to reddit user gripejones here: https://www.reddit.com/r/PHPhelp/comments/3tykpc/php_7_and_ldap/ PHP 7 requires an environment variable (LDAPCONF) set to the location of your config file. It used to be that you could put the config file either in this ...


0

Turns out all I needed to do is add a DirectoryIndex rule to the htaccess file and it started working as intended. Thanks.


0

This behavior is common if you have a memory leak in a plugin. This results in memory starvation, and the server threads start paging in and out of memory. It can also happen if you allow too many threads as Apache will spawn new threads as load goes up. There are a number of settings that can be used to work around the issue. Setting MaxRequestWorkers ...


0

What i forgot to do: There are two php.ini files. One in /etc/php5/apache2/php.ini and /etc/php5/cli/php.ini . I forget to configure the cli file and I didn't add the extension oci8.so. I think everyone who has more to do with PHP knows this, I only provide the solution because maybe they are some newbie like my searching for the solution.


0

Would be nice to see some of your php code; what are you trying to achieve with echo ""? Anyway, you could try it with "sh -c" and "disown", like so: <?php exec("sudo sh -c 'sleep 3 && service php5-fpm restart' >/dev/null 2>&1 & disown"); echo("done"); ?> "sudo" with exec() will only work, if you put www-data in the ...


3

This should be a comment, but its a bit long. This system is not coping with the demand being placed on it. However you've not provided nearly enough information to diagnose what is going on let alone fix the problem. But the information needed is orders of magnitude greater than would be considered appropriate for a post here. But you did ask a specific ...


1

I had this same problem, almost always this is something related to incompatible versions(apache and php) or compiled with different compilers(VC11, VC14) of for different platform(64bit 32bit). So just make sure you have everything as compatible as possible. I finally got it working with: httpd-2.4.20-win32-VC11 php-5.6.20-Win32-VC11-x86


0

I know this post is quit old, but i just have faced this problem on ubuntu when i called for PECL command. The only thing that helped me is to install php-xml package. First check if you have xml module already installed php -m if you don't find it then you have to sudo apt-get install php-pear it will automatically install php-xml package. or you ...


0

Try putting the restart command in a shell script, starting with the sleep period. So your php function calls the script on the server, rather than restarting php directly. This way it cannot kill itself. Also check this answer to see how it can be done directly: http://stackoverflow.com/questions/9798438/automatically-restart-php-script-on-exit ...


0

If there is no php5apache2_2.dll, means that you downloaded PHP nts (non-Thread Safe), you have to download PHP ts (Thread-Safe), this version has the phpXapache2_X.dll files.


0

The cleanest way to do what you are asking is to create two separate VirtualHost in your configuration. The first VirtualHost will define the default virtual host, which will be used to server all clients specifying a hostname unknown to the server. If you are using a distribution where the convention is to put all VirtualHost in a single configuration ...


0

I meet the same Question like yours. and i try to do below you should know the 'role' of http execute. Just like your 'apache' create your ssh key sudo -u apache ssh-keygen -t rsa and the path of the key will be show in the cmd screen. go to the path and cat id_rsa.pub, copy your key and post to the github or gitlab finally, because your server dont know ...


0

When using chroot for PHP-FPM, you have to define SCRIPT_FILENAME relative to the chroot environment. SCRIPT_FILENAME tells PHP-FPM where to find your script. For example, if your web site index page is in /var/www/index.php, and your chroot is set to /var/www, the SCRIPT_FILENAME has to be /index.php instead of /var/www/index.php, which is the default ...


0

In Bash you may use this fancy syntax: echo flush_all > /dev/tcp/localhost/11211 Otherwise use memflush command: memflush --servers=localhost


1

The first block works for me (with or without trailing slash), so there may be another conflicting location in your configuration which prevents one variant from working. The second block is not capturing the leading '/' of the URI so the test if (!-f $document_root$fastcgi_script_name) always fails. I presume that your php-fpm configuration must already ...


0

I would check and see what the latest version is available though the SLES repos, if there is a 5.3.3 version, then a simple zypper up will do the necessary clean update. I would avoid using an external source for the install as the whole premiss of SLES is certified updates for enterprise level updates, especially on production systems. To try and remove ...


0

I've managed to configure it in a PHP5-CGI & mod_fcgid setup and it kind of does what I need. It does not send everything to the client as it was generated by PHP automatically, but the flush() command started to work. The TTFB times dropped a bit. I'll keep working on that and update this answer if I find out anything useful. I've used the following ...


0

If somebody exists with this problem, this is the answer I got via technical Support: You only get the module and access the other modules, if you have a subscription. But if you don't need Patches, Updates etc. you can use the 60Day Trial and install everything you want and after the 60days the system stays how it is. But if you are a ISV/HSV are something ...


-3

Some good answers, but don't forget that NONE of the default installs are very secure as they are meant to be used in the widest possible range of situations. Seriously, if you think a default install of Apache on Linux is secure... guess again.



Top 50 recent answers are included