magento - cloning webshop results in http500 - PHP fatal error - php

i am trying to clone my webshop again for a test environment.
(magento 1.6.2 on a dedicated server)
I never had any trouble doing this.
I just deleted all the old content in FTP and DB and then i make a copy of the live store and synchronize the db.
Then i change the url in the db and the test-db in the local.xml.
I also clean the var/cache and var/session.
This always worked well.
But yesterday did the same ... but now i get a http 500 error. (white screen)
From the error logs:
"GET / HTTP/1.1" 500 222 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20100101 Firefox/13.0.1"
and
PHP Fatal error: Call to a member function getCode() on a non-object in /var/www/vhosts/liefstoereigenwijs.nl/testwinkel/app/code/core/Mage/Core/Model/App.php on line 701
I tried to use the magento-cleanup.php and i also changed all permissions to 775.
But all without result ...
Has anyone have a clue?
UPDATE:
In the system.log i see the following errors:
2012-07-10T12:33:53+00:00 ERR (3): Recoverable Error: Argument 1 passed to Mage_Core_Model_Store_Group::setWebsite() must be an instance of Mage_Core_Model_Website, null given, called in /var/www/vhosts/liefstoereigenwijs.nl/testwinkel/app/code/core/Mage/Core/Model/App.php on line 648 and defined in /var/www/vhosts/liefstoereigenwijs.nl/testwinkel/app/code/core/Mage/Core/Model/Store/Group.php on line 235
2012-07-10T12:33:53+00:00 ERR (3): Notice: Undefined index: 1 in /var/www/vhosts/liefstoereigenwijs.nl/testwinkel/app/code/core/Mage/Core/Model/App.php on line 701

Memcache and/or Varnish cache were the problem.
I fushed all caches in the live store, and that was the solution for me.

Related

PHP-fpm session_start() undefended in ptero container

I have a pterodactyl container running with a nginx and fpm egg (https://gitlab.com/tenten8401/pterodactyl-nginx) and am trying to get my sharex image uploader moved from my old site. However every time i try and access the site i get this error
2021/06/08 19:25:38 [error] 19#19: *7 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Call to undefined function session_start() in /home/container/webroot/index.php:4
Stack trace:
#0 {main}
thrown in /home/container/webroot/index.php on line 4" while reading response header from upstream, client: ip.address, server: , request: "GET / HTTP/1.0", upstream: "fastcgi://unix:/tmp/php-fpm.sock:", host: "ip.address:20004"
173.249.9.172 - - [08/Jun/2021:19:25:38 +0000] "GET / HTTP/1.0" 500 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/ip.address Safari/537.36"
I have tried installing the package as found in this answer (Call to undefined function session_start()) but it just says opkg isnt found on the path as for the php -i once again says php isnt found on the path (both run inside the docker container). I have also tried apk add php7-mod-session but i get a permission error from the container.
I have tried a few things from adding php-mod-session to the apk add and some other stuff but nothing ever changes the error so i dont believe any of these are the right line of progress.
Any help or hints in the right direction would be great, me and my friend have been working on this for a week or so now but cant find the fix. I can also add config files and stuff if you feel they might help, just ask.

Why is searching not returning results in Magento 1.9 with error messages appearing in nginx logs for FastCGI and Elastica?

I'm running Magento 1.9.4 on Ubuntu 18.04, PHP 7.2 with nginx 1.14 fronting it all. The shopping site is loading and navigable. However, when I search for a term, it does not list the matches in the drop-down and shows the no results page.
I can see the following message in the nginx error logs:
2020/05/22 14:54:51 [error] 1213#1213: *270 FastCGI sent in stderr: "PHP message: PHP Warning: array_keys() expects parameter 1 to be array, null given in /var/www/example.com/lib/Elastica/Status.php on line 69
PHP message: PHP Warning: in_array() expects parameter 2 to be array, null given in /var/www/example.com/lib/Elastica/Status.php on line 81
PHP message: PHP Notice: Undefined index: version in /var/www/example.com/lib/Elastica/Client.php on line 108" while reading response header from upstream, client: 72.71.71.72, server: www.example.com, request: "GET /catalogsearch/result/?q=trouser HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "www.example.com", referrer: "https://www.example.com/boutique/"
This was working prior to upgrading from Ubuntu 14.04 and PHP 7.0.
I need to find another job.
Magento is using Elastica client which in turn is pointing to AWS ElasticSearch service. I had to whitelist the host (Magento site) in the AWS ElasticSearch access policy in order for it to access the service.

505 Error Heroku Deploying Personal Website

I'm trying to host my personal website on heroku. My website only has html, css, and javascript files, and I read that heroku only deploys apps written in ruby, node, scala, php, etc. So, I followed this tutorial (http://www.lemiffe.com/how-to-deploy-a-static-page-to-heroku-the-easy-way/) and changed my index.html file to home.html and included an index.php file that has the following code: <?php include_once("home.html"); ?>.
I've successfully pushed it to heroku, but when I open the heroku url of my app, it gives me a 505 error.
Below is my heroku log:
2015-11-14T02:42:05.497208+00:00 heroku[api]: Deploy 63ae6bd by email#gmail.com
2015-11-14T02:42:05.497305+00:00 heroku[api]: Release v4 created by email#gmail.com
2015-11-14T02:42:05.651545+00:00 heroku[slug-compiler]: Slug compilation started
2015-11-14T02:42:05.651555+00:00 heroku[slug-compiler]: Slug compilation finished
2015-11-14T02:42:05.820048+00:00 heroku[web.1]: State changed from up to starting
2015-11-14T02:42:08.998026+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2015-11-14T02:42:09.746422+00:00 heroku[web.1]: Starting process with command `vendor/bin/heroku-php-apache2`
2015-11-14T02:42:09.909064+00:00 app[web.1]: Going down, terminating child processes...
2015-11-14T02:42:10.844965+00:00 heroku[web.1]: Process exited with status 0
2015-11-14T02:42:12.439647+00:00 app[web.1]: Starting php-fpm...
2015-11-14T02:42:12.243079+00:00 app[web.1]: Optimizing defaults for 1X dyno...
2015-11-14T02:42:12.435588+00:00 app[web.1]: 4 processes at 128MB memory limit.
2015-11-14T02:42:14.442033+00:00 app[web.1]: Starting httpd...
2015-11-14T02:42:14.672772+00:00 heroku[web.1]: State changed from starting to up
2015-11-14T02:44:38.663711+00:00 heroku[router]: at=info method=GET path="/" host=mywebsite.herokuapp.com request_id=45aae2bd-a6f8-4023-86cf-6aedd5d23882 fwd="138.110.234.184" dyno=web.1 connect=12ms service=2ms status=500 bytes=224
2015-11-14T02:44:38.663113+00:00 app[web.1]: [14-Nov-2015 02:44:38 UTC] PHP Parse error: syntax error, unexpected '?' in /app/index.php on line 1
2015-11-14T02:44:38.663580+00:00 app[web.1]: 10.146.233.83 - - [14/Nov/2015:02:44:38 +0000] "GET / HTTP/1.1" 500 - "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36
You said 505 error (505 is really quite an exotic error!) but it is actually just a 500 error according to the log you pasted. 500 is the typical server side error, in this case:
PHP Parse error: syntax error, unexpected '?' in /app/index.php on line 1
I'd bet your php file has a space in it or something that isn't quite right. Make sure it looks like what you pasted as instructed here: https://stackoverflow.com/a/17531897/237091
Well , whenever your Web-page's contain HTML, CSS and JavaScript , so follow just 2 steps :
1) Make one file give name as index.html (keep evreything in it) ex:script,stylesheet & body.
2) Now, change these file, copy and paste these same file but change domain to index.php
Then deploy on a Heroku.
Hence this method will help you to deploy your Web-Pages

PHP Heroku - Call undefined function mb_detect_encoding()

I'm trying to deploy a PHP project to Heroku. I use composer with to install slim framework and simple_http_dom dependencies. Here content of my composer.json:
{
"require": {
"slim/slim": "2.4.3",
"shark/simple_html_dom": "dev-master"
}
}
when I run the app locally, it's working fine. Then I tried to push it to Heroku, and it seems successful, I saw no error message.
However, there is a problem when I tried to access it from the browser. nothing shows up. Below is the log from heroku logs command.
[Sun Aug 31 00:14:37.566291 2014] [proxy_fcgi:error] [pid 60:tid 140467698300672] [client 10.2.162.208:58783] AH01071: Got error 'PHP message: PHP Fatal error: Call to undefined function mb_detect_encoding() in /app/vendor/shark/simple_html_dom/simple_html_dom.php on line 1234\n', referer: http://myapp.herokuapp.com/index.php/scrap/all
[31/Aug/2014:00:14:37 +0000] "POST /index.php/scrap/all/do HTTP/1.1" 500 - "http://myapp.herokuapp.com/index.php/scrap/all" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.94 Safari/537.36"
[31-Aug-2014 00:14:37] WARNING: [pool www] child 58 said into stderr: "NOTICE: PHP message: PHP Fatal error: Call to undefined function mb_detect_encoding() in /app/vendor/shark/simple_html_dom/simple_html_dom.php on line 1234"
One piece from the error that might be interesting:
Got error 'PHP message: PHP Fatal error: Call to undefined function mb_detect_encoding() in /app/vendor/shark/simple_html_dom/simple_html_dom.php on line 1234\n', referer: http://myapp.herokuapp.com/index.php/scrap/all
This is the first time I got the above error. I have another app running on Heroku using the same dependencies (but without composer) and it's working fine, but this one isn't.
what should I do to fix this problem?
The problem is that the mbstring extension isn't enabled by default, see https://devcenter.heroku.com/articles/php-support#extensions
Just add ext-mbstring as a dependency to your composer.json so it looks like this:
{
"require": {
"ext-mbstring": "*",
"slim/slim": "2.4.3",
"shark/simple_html_dom": "dev-master"
}
}
Heroku will then auto enable the extension when you git push.

PHP GAE not able to run SDK locally

I installed the latest SDK for php 1.8.1 and I am having trouble getting it to run locally
D:\google_appengine 1.8.1>dev_appserver.py --php_executable_path=D:\PHP\php-cgi.exe \Testing --port=5000
INFO 2013-06-13 03:16:30,931 sdk_update_checker.py:244] Checking for updates to the SDK.
INFO 2013-06-13 03:16:32,851 sdk_update_checker.py:260] Update check failed: HTTP Error 404: Not Found
**WARNING 2013-06-13 03:16:32,861 api_server.py:314] Could not initialize images API; you are likely missing the Python "PIL" module.**
INFO 2013-06-13 03:16:32,868 api_server.py:138] Starting API server at: http://localhost:60628
INFO 2013-06-13 03:16:32,874 dispatcher.py:164] Starting server "default" running at: http://localhost:5000
INFO 2013-06-13 03:16:32,878 admin_server.py:117] Starting admin server at: http://localhost:8000
ERROR:root:php failure (255) with:
X-Powered-By: PHP/5.4.16
Content-type: text/html
Warning: require_once(google/appengine/runtime/ApiProxy.php):
failed to open stream: No such file or directory in
D:\google_appengine 1.8.1\google\appengine
\tools\devappserver2\php\setup.php on line 21 INFO
2013-06-13 03:16:40,938 server.py:593] default: "GET / HTTP/1.1" 500 -
Fatal error: require_once(): Failed opening required
'google/appengine/runtime/ApiProxy.php' (include_path='D:\Testing') in
D:\google_appengine 1.8.1\google
\appengine\tools\devappserver2\php\setup.php on line 21
I am trying to find what the problem is but have no idea what is wrong. What is the PIL module I am missing?
The error says that ApiProxy.php is missing but it is located at
D:\google_appengine 1.8.1\php\sdk\google\appengine\runtime
Some one posted a similar issue and said they fixed it by doing the following
The problem is I also have a python version Google-App-engine. In
order to solve this this problem, I need to specify the
"dev_appserver" to PHP-GAE-SDK
I have no idea what that and will it fix the errors shown. Any thoughts?
Google seems to have messed up a little when they made the 1.8.1 revision on Windows. To fix it, go into this file:
D:\google_appengine 1.8.1\google\appengine\tools\devappserver2\php\runtime.py
You should find this at line 112:
if sys.platform == 'win32':
include_path = 'include_path=%s' % ';'.join(include_paths)
Change that to:
if sys.platform == 'win32':
include_path = 'include_path="%s"' % ';'.join(include_paths)
Note the extra pair of quotes around the %s.

Categories