HHVM returns error 500 - php

currently i am trying to setup a hhvm server. PHP Applications works fine for me, hack lang php files not.
My local sandbox returns (every request in error.log):
[Fri Jun 20 15:31:43.725292 2014] [proxy:debug] [pid 26542] proxy_util.c(1694): AH00925: initializing worker fcgi://127.0.0.1:9000/var/www/hhvm.local/$1 shared
[Fri Jun 20 15:31:43.725314 2014] [proxy:debug] [pid 26542] proxy_util.c(1734): AH00927: initializing worker fcgi://127.0.0.1:9000/var/www/hhvm.local/$1 local
[Fri Jun 20 15:31:43.725325 2014] [proxy:debug] [pid 26542] proxy_util.c(1785): AH00931: initialized single connection worker in child 26542 for (127.0.0.1)
My Apache Config:
<virtualhost *:80>
# Admin email, Server Name (domain name) and any aliases
ServerAdmin admin#domain.de
ServerName hhvm.local
ServerAlias www.hhvm.local
# Index file and Document Root (where the public files are located)
DirectoryIndex index.php index.html
DocumentRoot /var/www/hhvm.local
# Custom log file locations
LogLevel debug
#LogLevel warn
ErrorLog /var/www/hhvm.local/log/errors.log
CustomLog /var/www/hhvm.local/log/access.log combined
ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/var/www/hhvm.local/$1
<Directory /var/www/hhvm.local>
Options Indexes FollowSymLinks MultiViews
AllowOverride FileInfo All
Order allow,deny
Allow from all
Require all granted
</Directory>
Apache (2.4) is running, HHVM Daemon (3.0) is running,
~$: hhvm index.hh
<!DOCTYPE html><html><head></head><body>Hello World!<br />Running on HHVM version 3.1.0</body></html>
If i call "hhvm.local" the server response a 500 Internal Server Error.
OS: Ubuntu 14.04
Could anybody help me? :)

What happens when you do hhvm index.php
- index.php with only a echo is enough
Does it ouput something?
Yes?
Try service hhvm start
At least at my setup hhvm did not always start on it's own ...
No?
Then you probably have an install issue. There are 2 ways to install HHVM on ubuntu
- self compiling
- pre built
I personly use the pre built. At least the is the way I got it working :)
Hope it helps

Your ProxyPassMatch isn't set up to sniff out hh file extensions. You should use the following instead...
ProxyPassMatch ^/(.+\.(hh|php)(/.*)?)$ fcgi://127.0.0.1:9000/var/www/hhvm.local/$1

Related

No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /var/run/php/php5.6-fpm.sock (*) failed

I have such virtual host settings
<VirtualHost *:80>
ServerAdmin webmaster#localhost
DocumentRoot /var/www/html
<FilesMatch \.php$>
SetHandler "proxy:unix:/var/run/php/php5.6-fpm.sock|fcgi://localhost/"
</FilesMatch>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
phpinfo() shows that my site has a version of php 5.6. All right!
Now I am trying to restrict the rights with Mod_Ruid2. I added the following to my virtual host
RDocumentChRoot /var /www/html
<Directory "/www/html/">
Require all granted
RMode config
RUidGid admin0 admin0
</Directory>
after trying to get to the site I see an error in the logs
[Sun Oct 13 16:09:02.492117 2019] [proxy:error] [pid 13571] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /var/run/php/php5.6-fpm.sock (*) failed
[Sun Oct 13 16:09:02.492194 2019] [proxy_fcgi:error] [pid 13571] [client 192.168.0.110:47622] AH01079: failed to make connection to backend: httpd-UDS
Tell me, what am I doing wrong?
I've just faced the same issue while trying to run apache(2.4) + php(7.2) over CentOS 8.
[Thu Jan 09 06:59:10.420499 2020] [proxy:error] [pid 121:tid 139846433412864] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /run/php-fpm/www.sock (*) failed
[Thu Jan 09 06:59:10.420535 2020] [proxy_fcgi:error] [pid 121:tid 139846433412864] [client 127.0.0.1:55580] AH01079: failed to make connection to backend: httpd-UDS
To solve this, I had to launch a service called "php-fpm" (sudo systemctl enable --now php-fpm), that led me to another error:
[09-Jan-2020 07:07:09] ERROR: unable to bind listening socket for address '/run/php-fpm/www.sock': No such file or directory (2)
[09-Jan-2020 07:07:09] ERROR: FPM initialization failed
That was caused by the folder /run/php-fpm not existing.
mkdir -p /run/php-fpm/
After that, just launched again php-fpm, this time without errors and apache+php worked like a charm.
Note that there is a small difference between your error and mine, the paths are a bit different. Instead of "/run/php-fpm/" you should create "/var/run/php/".
Hope this helps
I faced the same issue, in my case I could fix it by restarting PHP fpm service, by running code:
sudo service phpx.x-fpm restart
OS: centos
Webserver: nginx
i had same issue on CentOS 8 and Apache 2.4.37 and after many hour research in internet , i can't found any solution for unix domain proxy.
i don't know this is a bug or bad document?
for resolve this problem only you must be replace proxy:unix:/YOUR_PATH with proxy:unix://YOUR_PATH.
<FilesMatch \.php$>
SetHandler "proxy:unix:///var/run/php/php5.6-fpm.sock|fcgi://localhost/"
</FilesMatch>
notice : ...|fcgi://localhost/ must be exists.
after your change this setting the new problem appears :
File not found.
this error is good because we were able connected to php-fpm from apache.
i think this problem is bug. please see this link.
https://bugs.php.net/bug.php?id=55322
for resolve this problem you must be implement this structure :
httpd.conf
<VirtualHost *:80>
ServerName www.example.com
DocumentRoot /var/www/example.com/public_html
#your configs ....
</VirtualHost>
/etc/php-fpm.d/example.com.conf
[example.com]
;your configs...
chroot = /
access.log = /var/www/$pool/logs/phpfpm-access-$pool.log
php_admin_value[open_basedir] = /var/www/$pool/public_html
;your configs...
I've just faced the same issue, I commented this part of code in my drupal.con (could be another one for you)
#<FilesMatch \.php$>
# SetHandler proxy:unix:/run/php-fpm/www.sock|fcgi://localhost/
#</FilesMatch>
And the website just show up. Apparently I did not need it on this serveur (redhat 7), but I needed it in my CentOS for the same project.
Please note I had this come up today and I found the solution on serverfault. pfrenssen's answer specifically. Note the field name tripped me up for an hour as listen.group and group both exist. I then needed to comment a line listen.acl_users out which was uncommented by default. It important to note that the www-data user I am using is the user I have predefined (non-default) apache user. I believe this to be the underlying cause. Below is my one liner to change these values. Use cp /etc/php-fpm.d/www.conf /etc/php-fpm.d/www.conf.default first to help test as sed modifies the file in place.
sed -i -e 's/user = apache/user = www-data/g' \
-e 's/group = apache/group = www-data/g' \
-e 's/;listen.owner = nobody/listen.owner = www-data/g' \
-e 's/;listen.group = nobody/listen.group = www-data/g' \
-e 's/;listen.mode = 0660/listen.mode = 0660/g' \
-e 's/listen.acl_users = apache,nginx/;listen.acl_users = apache,nginx/g' /etc/php-fpm.d/www.conf

PHPMyadmin HTTP 500 after PHP 5.6 upgrade

I am in need of assistance. I am unable to access phpMyAdmin on my DO VPS after just recently upgrading the system to PHP5.6. I have done a lot of research over the past few day but to no avail. I want to list out everything that I have to do to see if anybody has any words of wisdom. The most recent this I attempted I found in this SO Answer
Internal server error (HTTP Error 500) after installing phpmyadmin on a certain domain
I checked my Apache Logs and this line stood out
[Tue Nov 29 02:42:20.684526 2016] [:error] [pid 12443] [client 66.169.11.19:56234] PHP Fatal error: require_once(): Failed opening required './libraries/php-gettext/gettext.inc' (include_path='.') in /usr/share/phpmyadmin/libraries/select_lang.lib.php on line 395
So I did the following:
sudo apt-get install php5.6-gettext
And received the following response
Note, selecting 'php5.6-common' instead of 'php5.6-gettext'
php5.6-common is already the newest version.
php5.6-common set to manually installed.
I would like to point out an oddity that may assist.
Everytime I restart Apache I get this Warning:
[Tue Nov 29 02:42:11.553293 2016] [so:warn] [pid 12438] AH01574: module php5_module is already loaded, skipping
Can anybody assist me with this?
Here is my Vhost for phpMyAdmin
<VirtualHost *:80>
ServerAdmin admin#localhost
DocumentRoot "/usr/share/phpmyadmin"
ServerName pma.example.net
ErrorLog "/var/log/pma-error.log"
CustomLog "/var/log/pma-access.log" combined
<Directory "/usr/share/phpmyadmin">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Not only am I unable to access at the sub domain that I have set up I am also unable to access it from [Server IP Address]/phpmyadmin
I receive an HTTP 500.
Thank you.
One thing that may solve the problem is to remove PHPMyAdmin, and reinstall it.
sudo apt-get remove phpmyadmin
sudo apt-get install phpmyadmin
By doing this, you'll give Ubuntu a chance to install the appropriate dependencies for phpmyadmin. Chances are, this will configure your packages in further ways that just installing a newer PHP version doesn't.
I think you should run http://pma.example.net
And restarted Apache:
sudo service apache2 restart

Server Error 500 Centos

Hi i have a Centos 6 64 bit
it has LAMP installed html works php doesnt work
when i try opening a php gamepanel on : http://51.255.199.40/gpanel/ , i get Server Error 500, and in the error_log of apache i get:
[Sat Mar 05 14:45:58 2016] [error] [client 46.99.49.96] Directory index forbidden by Options directive: /var/www/html/
Here is my httpd.conf my php.conf and a file named welcome.conf , php and welcome.conf are in conf.d folder and httpd.conf is in the conf folder:
http://pastebin.com/xSzPrMmi
Im not that good on coding i need help getting this fixed im since 5 days with this problem and still no fix
my email address is : benjaminselmani5#gmail.com if you guys need to contact me i will watch the topic too.
With Respect
Benjamin Selmani
Change AllowOverride None to AllowOverride All inside httpd.conf's block
<Directory "/var/www/html">
AllowOverride All
</Directory>

XAMPP Apache Virtual host on NAS

I tried to create a virtual host for local xampp apache (windows7) with no luck.
What I tried:
hosts contains:
127.0.0.5 mycloud
httpd-vhosts.conf contains:
<VirtualHost 127.0.0.5:80>
DocumentRoot \\WDMYCLOUD\user
ServerName mycloud
DirectoryIndex index.html index.php
<Directory "\\WDMYCLOUD\user">
Options Indexes FollowSymLinks Includes ExecCGI
Order allow,deny
Allow from all
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
apache runs as service as local user, not System.
'user' in directory has same password on local machine and NAS. It includes an index.html.
I tried a lot of different variations, but mostly apache won't start. With this configuration apache starts but eror log shows following:
[Fri May 15 08:51:49.224900 2015] [authz_core:error] [pid 12280:tid 1720] [client 127.0.0.1:53075] AH01630: client denied by server configuration: C:/WDMYCLOUD
The network drive must have the letter Z: and not C:.
Can anyone help? Thanks.

Multiple php/symfony2 applications on apache 2.4.7 virtual host

I'm forcing a really strange issue since I was forced to move a few of my symfony2 applications to a new server with Ubuntu 14.04 and Apache2 2.4.7.
There are 4 different symfony2 applications at the same server, configured with virtual hosts. Each has its own domain, account in the system, and configuration.
The strange thing that happens is, that once i restart the apache2 server (or reload the configuration) only one of those 4 sites would work, and that would be the first one typed in the browser. All other pages generate this kind of errors:
[Tue Sep 09 10:30:27.437009 2014] [:error] [pid 16400] [client XXX.XXX.XXX.XXX:44531] PHP Fatal error: Class 'Avalanche\\Bundle\\ImagineBundle\\AvalancheImagineBundle' not found in /home/user1/project/app/AppKernel.php on line 27
or
[Tue Sep 09 10:41:47.794413 2014] [:error] [pid 16398] [client XXX.XXX.XXX.XXX:44947] PHP Fatal error: Class 'Project2\\CoreBundle\\Project2Bundle' not found in /home/user2/project2/app/AppKernel.php on line 19
The very strange thing is that it happens only to all the sites that haven't been visited as the first one after apache2 restart/reload.
All the sites have a proper, as I suppose, virtual host configuration:
<VirtualHost *:80>
ServerAdmin me#server.com
ServerName project1.nl
ServerAlias www.project1.nl
DocumentRoot "/home/user1/project1/web"
DirectoryIndex app.php
<Directory "/home/user1/project1/web">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/project1-error.log
CustomLog ${APACHE_LOG_DIR}/project1-access.log combined
</VirtualHost>
Does anyone have an idea where to start looking? I've checked multiple configurations of virtual hosts, php-fpm configuration, configuration of every single application, but I couldn't find a way out.
It was the problem with xcache (http://xcache.lighttpd.net/ticket/337)
Setting opcache.optimization_level=0 solved this problem for me.
Here is one of our vhost setup which works for sf2
ServerName demo.example.fr
ServerAlias demo.example.fr
ServerAdmin admin#example.fr
DocumentRoot /var/www/vhosts/demo.example.fr/httpdocs/web/
<Directory /var/www/vhosts/demo.example.fr/httpdocs/web/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /app.php [QSA,L]
</IfModule>
</Directory>
like you will notice , we don t setup directory index , only a url rewriting with mod_rewrite
There are some things in your configuration.
In Apache 2.4 you have to define the options with + or -.
Options -Indexes +FollowSymLinks +MultiViews
You don't need the DirectoryIndex because its rewritten in your .htaccess file.
I hope you have enabled all your configurations with a2ensite otherwise all other vhost files are not loaded.
The next thing is to clear the complete Symfony2 cache folder and clear your APC cache if you use it. Sometimes APC cache some objects and you have some strange errors.
I have spent two days trying to figure out this exact same problem after upgrading to Ubuntu 14.04 and Apache 2.4.7.
What solved it for me was disabling xcache because it was caching the files of the first application called after a php app/console cache:clear or php composer.phar update which resulted in sometimes getting the application A and sometimes application B.
I figured that out once I tried to debug symfony2 by adding var_dump instructions at various steps in application A. When I got inside $kernel->handle() (called from app.php), I could not get any output regardless of what I tried. I suspected that AppKernel of application B was called but when I tried to modify that one, it did not change the result. This is when I realised that the file was cached somewhere. I hadn't paid any attention to that because I did not install apc but apparently xcache was enabled.
I suppose this issue arises because the namespace and the class names are exactly the same in both symfony2 applications...
I will try to see if it's possible to add a prefix per application for xcache to know that they are different.
TLDR: Disable xcache because with apache2's original configuration, it cannot discriminate between both applications and mixes up the cache.

Categories