Getting Http "ERROR 500" with symfony4 using byethost - php

I have uploaded the project in the server, but when i go to the link of my site url.com/public/index.php i see this error HTTP ERROR 500.
I have make a clear to cache and same problem
Any suggestion to solve this problem? CAN I disable the putenv() in symfony?
after displaying error, i see this message :
Warning: putenv() has been disabled for security reasons in
/home/vol15_7/byethost8.com/b8_23863116/htdocs/vendor/symfony/dotenv/Dotenv.php
on line 130

The putenv function is forbidden on your server. Your hosting provider has certainly forbidden the usage of this function which is used by DotEnv component.
Try to use another method to set environment variable like described in Symfony documentation about server configuration.

For anyone struggling with this issue on some hosting without the possibility to enable dotenv.
Symfony provides a way to dump .env variables into a PHP file. This way it won't try to use dotenv at all.
All you need to do is to run composer dump-env prod
Source: https://symfony.com/doc/current/configuration.html#configuring-environment-variables-in-production

Related

Laravel new error displaying package (Ignition) causes error on shared hosting

Laravel's new error displaying package runs command at startup and it causes the error
Process class relies on proc_open, which is not available on your PHP installation.
Here is error trace
at Process->__construct('git log --pretty=format:\'%H\' -n 1', '/home/u7640462/congresssun.com/dev')
in AddGitInformation.php line 50
at AddGitInformation->command('git log --pretty=format:\'%H\' -n 1')
in AddGitInformation.php line 25
It's shared hosting so I'm not able to change php.ini file effectively. I can't enable proc_open on php.ini
So how can I get away with this error?
Even if I set .env for production and close debugging it gives me the above error.
It appears you can turn off the Git functionality by modifying your config/flare.php configuration to set flare.reporting.collect_git_information to false.
This is the only spot that uses the Process class so it should resolve this issue, at least.
(Fundamentally, though, find a better web host that doesn't do this. You are likely to run into other issues with disabled functionality that may be much harder to work around.)

Unable to install Opencart 3.0.2.0 in Linux Server

When I try to install Opencart V3.0.2.0 in Linux server, getting following error message.
Fatal error: Internal Zend error - Missing class information for in
/system/storage/vendor/twig/twig/lib/Twig/ParserInterface.php on line
31
I am not able to start my installation process. Any idea, Please help.
While this is not guaranteed to work, but since few people reported that they have been able to solve it disabling APC I would give it a try.
If you want to disable Alternative PHP Cache (APC), you can do so by modifying your PHP initialization file file.
Using your hosting account's editor (Web & Classic / cPanel / Plesk), open your website's PHP initialization file.
Note: I recommend backing up your PHP initialization file file before modifying it. You can do this by copying and renaming it in your file manager.
On a new line, type apc.enabled=0
Save your changes.

Symfony2 RuntimeException: The autoloader expected class "Doctrine\DBAL\Driver\PDOMySql\Driver" to be defined

I've deployed my site to my development server using Capifony and although it has been deployed correctly when I go the the site i.e dev.xyz.co.uk/app_dev.php I get the following error:
RuntimeException: The autoloader expected class "Doctrine\DBAL\Driver\PDOMySql\Driver" to be defined in file "/var/www/vhosts/dev.xyz.co.uk/shared/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php". The file was found but the class was not in it, the class name or namespace probably has a typo.
Any idea what's causing it? It works fine when deploying to production.
You may check the first line of the file "Driver.php" just to read <?php.
If you just read <? and tried to deploy on differents servers for dev and prod, just check if they have the same value for "short_open_tag" (in php.ini).
If it's "on" on your prod's server and "off" on your dev's server you may have this error.
It can be problem of accelerator (xcache, eaccelerator, apc). Restart PHP it can help.

WP E Commerce Safe Mode restriction error

I have my online shop, created with WP Ecommerce getting broken after I moved it to another server. I could be sure that the problem comes from WP Ecommerce because when I disable that plugin. Everything run as expected. This is the exact error message
Warning: session_start() [function.session-start]: SAFE MODE Restriction in effect. The script whose uid is 515 is not allowed to access /tmp owned by uid 0 in /home/mikalu/public_html/wp-content/plugins/wp-e-commerce/wpsc-core/wpsc-constants.php on line 17
Fatal error: session_start() [<a href='function.session-start'>function.session-start</a>]: Failed to initialize storage module: files (path: ) in /home/mikalu/public_html/wp-content/plugins/wp-e-commerce/wpsc-core/wpsc-constants.php on line 17
I've tried to turn off safe mode on my php configuration. nothing happens. the error's still there.
I thought it was some kind of permission issue, so I tried to change /tmp permission to 777. Nothing happens. I googled it some more and suspect it might have something to do with fastCGI configuration and stuff. Which I totally don't understand.
My googling result mostly suggest me to consult the web hosting provider or even to move to another host. But in this case, I am the owner of the server (VPS with cPanel/WHM). And I don't have any idea how to solve this kind of problem
Any help would be very much appreciated :)
edit: I'm not so sure of this is really a server issue. Because if it really server configuration issue on session save path. Then the whole wordpress shouldn't be working coz it obviously use some session too. The session problem only come from that particular wp-ecommerce script. That's why I post it here on stackoverflow too.
After your edit, it's more clear why you ask that question. Wordpress itself does not uses PHP session, so it's not causing the issue but those component you're using is using PHP sessions.
The PHP manual normally is a good start to understand safemode and how to disable it: http://php.net/manual/features.safe-mode.php
Additionally you should review your server configuration that it is safe instead. Safe-mode is unsafe. Hopefully your server ain't.

imagecreatefromjpeg() error - Why is my image manipulation script failing?

I am currently using an image manipulation script to do some work on uploaded images and I'm running into a problem in my dev environment. This same code works on my production server.
The error is:
PHP Warning: imagecreatefromjpeg(): php_network_getaddresses:
getaddrinfo failed: Name or service not known in /path/to/script.php
on line 75
The line of code on 75 is:
$this->img = imagecreatefromjpeg(PHPTHUMB."?src=/".$this->image_path);
which creates an image that is loaded from another made by phpThumb, which is used for further manipulation.
Any ideas on how to solve this? Can anyone shed some light on what the error means?
Thank you,
Edit:
Just as a further bit of insight, if i visit PHPTHUMB . "?src=/" . $this->image_path in my browser, the image loads fine
User agent in php.ini did not solve the problem as indicated here
EDIT (SOLUTION): I had to add the INTERNAL 192.168.204.XXX IP into the hosts file, so that http://dev.mysite.com resolved correctly. Trying both 127.0.0.1 and the external IP yielded no result, but the internal works perfectly. Thanks for everyone's efforts,
I'm totally not sure about the cause of that error, but this is my best guess.
There is a particular PHP Setting which enables you to treat URLs as files. Normally imagecreatefromjpeg accepts a filename, I think. Since you are passing a URL, you need to make sure the particular setting is enabled. I believe you can find more info about it here: http://us2.php.net/file
filename
Path to the file.
Tip
A URL can be used as a filename with this function if the fopen
wrappers have been enabled. See
fopen() for more details on how to
specify the filename and List of
Supported Protocols/Wrappers for a
list of supported URL protocols.
Fopen wrappers: http://us2.php.net/manual/en/filesystem.configuration.php#ini.allow-url-fopen
Your dev environment may not be setup with this, but your production environment could be.
Edit
This page lists your error:
http://bugs.php.net/bug.php?id=11058
and mentions that a possible fix is by modifying your hosts file to explicitly include the ip/dns of the server you're accessing.
i tryed to reconfigure my named
configuration, without any result, to
fix this. the problem was solved by
adding the following line to my
/etc/hosts:
194.97.55.147 mx.freenet.de
Maybe you can try this?
did you also check that allow_url_fopen is set to On in php.ini?
I saw that they did mention that in the article you referred to in your post.
EDIT: Also, what OS and what PHP version are you running?
Just read this on php.net: "On Windows versions prior to PHP 4.3.0, the following functions do not support remote file accessing: include(), include_once(), require(), require_once() and the imagecreatefromXXX functions in the GD Functions extension."
EDIT2:
I just read what was written in the comments, your allow_url_fopen is set to On, sorry about that.
But OS, PHP version and phpinfo() would help in finding the problem.
The error message suggests something is wrong at a networking level. Thus, if possible, bypass that. Try using the path to the thumbnail generator, instead of a network address.
If that's not an option, try something that will give you more granular error messages. I suggest CURL. At the very least, it should yield a more informative error message.
The simple fact that this is failing is because on your webserver, your DNS resolution is broken.
If you have SSH access to your server, try the following command
dig hostname
where hostname is the host name from PHPTHUMB
This will probably fail.
Assuming that you're using Linux, my suggestion would be to edit your /etc/resolv.conf (as root)
and add the following line before any other lines beginning with "nameserver"
nameserver 4.2.2.2
This should hopefully fix things, though you may have to restart apache (or whatever webserver you're using)!
The issue here is that php fails to resolve the url that you provide as PHPTHUMB as stated in this bug report on php.net. This possibly means that it's the fault of the operating system/web server, in which case you can enter the ip address of the server you are connecting to into your hosts file manually.

Categories