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>
Related
Read almost all questions here, but no solution found. This drives me crazy already to do such simple stuff to run PHP on my localhost...
You don't have permission to access this resource.Server unable to
read htaccess file, denying access to be safe
ls -l
-rwxrwxrwx 1 user user 51 sep 27 14:42 .htaccess
ls -l
drwxrwxr-x 2 user user 4096 sep 27 15:17 www
Any help appreciated!
Check if there is an .htaccess file inside the www folder (and its permissions), since Apache looks for one at every directory up to the one where the requested file exists.
I'm coming from an Apache on Windows server background, but in regards to the .htaccess file, you can also put a "AllowOverride None" in your section of your httpd.conf file. At least in Windows, this means nothing can be overridden, therefore no need to look for .htaccess files.
You can also add a line to tell Apache that the "AccessFileName" is blank. Here are the entried I'm speaking of from my config file. I'm running a XAMPP server on Windows.
DocumentRoot "C:/xampp/htdocs"
<Directory "C:/xampp/htdocs">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride None
Require all granted
</Directory>
AccessFileName ""
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
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.
I am getting the following error from my website in the error logs:
[Wed Jul 02 07:13:58 2014] [error] [client **.**.**.**]
PHP Fatal error: require_once(): Failed opening required '/var/zpanel/hostdata/
zadmin/core/public_html/loader.php' (include_path='.:/usr/share/pear:/usr/share/php')
in /var/zpanel/hostdata/zadmin/public_html/cmcatering_co_uk/index.php on line 3
In index.php I have the following:
<?php
$code_base = "/var/zpanel/hostdata/zadmin/core";
require_once($code_base . "/public_html/loader.php");
?>
The loader.php file is in the correct place and so I am a bit confused as to why this is happening. I tried putting the core folder in /usr/share/php but this did not fix the problem. Any suggestions?
edit:
I have also just seen this error:
[Wed Jul 02 07:36:58 2014] [error] [client 94.10.110.115] PHP Warning: require_once(/usr/share/php/core/public_html/loader.php): failed to open stream: Operation not permitted in /var/zpanel/hostdata/zadmin/public_html/cmcatering_co_uk/index.php on line 3
httpd.conf:
# ZPanel Apache Include file for CentOS Linux
# Written by Bobby Allen, 15/05/2011
# Set the Zpanel Alias (used for development, sable will eventually use a VHOST)
Alias /zpanel /etc/zpanel/panel
# Setup the directory settings and PHP security flags for the Zpanel application directory.
<Directory /etc/zpanel/panel>
Options FollowSymLinks
AllowOverride All
DirectoryIndex index.php
<IfModule mod_php5.c>
AddType application/x-httpd-php .php
php_flag magic_quotes_gpc Off
php_flag track_vars On
php_flag register_globals Off
php_admin_value upload_tmp_dir /etc/zpanel/temp
</IfModule>
</Directory>
# Disallow web access to directories that don't need it/that we don't want people looking in!
<Directory /etc/zpanel/panel/cnf>
Order Deny,Allow
Deny from All
</Directory>
# Set server tokens (security??)
ServerTokens Maj
# Now we include the generic VHOST configuration file that holds all the ZPanel user hosted vhost data
Include /etc/zpanel/configs/apache/httpd-vhosts.conf
if you read the error message then you well see:
Operation not permitted
Your webserver process has no permissions to access
/usr/share/php/core/public_html/
In many cases webservers are bound to their root.
/var/zpanel/hostdata/
It looks as though this is a permissions issue due to the operation not permitted error. Look at whether your server is giving php access to the given folder in its configuration. Also just for a sanity check, echo out the filename as it is passed to your require_once.
Would be helpful if you posted your apache site config.
<?php
$code_base = "/var/zpanel/hostdata/zadmin/core";
require_once("<?php echo $code_base; ?>/public_html/loader.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