How do you display errors by editing the php.ini file in HHVM? - hhvm

I am using CentOS 7 and I have tried to edit the php.ini file located /etc/hhvm/php.ini.
I added the line
display_errors=On
The only two other lines in php.ini are
date.timezone="America/New_York"
hhvm.dynamic_extension_path = /usr/local/lib64/hhvm/extensions
When I try to run a page it shows a blank page (because of fatal error). But when I run the same file from the command line with
$ hhvm filename.php
Then the fatal error is displayed. How can I make errors show up while I develop? In regular PHP I can edit this in php.ini, or even just add lines like these
ini_set('display_startup_errors', 1);
ini_set('display_errors', 1);
error_reporting(E_ALL);
I have no idea how to do this in HHVM.

display_errors may or may not work in HHVM. There have been some issues with it, and I'm not sure what the current status is. You should check your log file.
Make sure you use a numeric value for error_reporting if you set it in the INI file. (Setting it with a constant in code is fine.) This bug prevents constants from working in INI files.

Related

error: (type 1): cannot open file for reading 'ugmm8a.pfb' in LaTeX (font depreciated)

I have been trying to compile my latex code in overleaf.com, but it keeps giving the errors as follows, and it does not point in which line of the code the error is located in:
It seems like a font issue there and here is the raw log of the error:
{/usr/local/texlive/2021/texmf-dist/fonts/enc/dvips/ly1/texnansi.enc}
! error: (type 1): cannot open file for reading 'ugmm8a.pfb'
! ==> Fatal error occurred, no output PDF file produced!
I need to solve this error to get my output document.
The urw-garamond fonts works just fine with texlive2021, you just need the ugmr8a.pfb from https://www.ctan.org/tex-archive/fonts/urw/garamond
https://www.overleaf.com/read/cmvfrqrkrnrq
(... however it might give better results not to use such a legacy font if you're already using lualatex, overleaf has many good fonts installed https://www.overleaf.com/learn/latex/Questions/Which_OTF_or_TTF_fonts_are_supported_via_fontspec%3F)
I have found the solution to this problem by myself.
Turns out the solution was just to change the Compiler (TeX Live) version of the overleaf.com project from 2021 to 2016 (since the 'ugmm8a.pfb' font got depreciated in the later version).
Hence I had to press the Menu option in the Top Left of my project, and then change the "TeX Live version" from 2021 to 2016 as shown in the screenshot below:
And after this one change when I recompiled, my document was successfully outputted without any errors.
As an additional info to people who are facing similar issues check this post by overleaf.com on how to add new fonts that do not exist on their server to your project: https://www.overleaf.com/learn/latex/XeLaTeX#Using_fonts_not_installed_on_Overleaf.27s_servers:_Google_Fonts_example

Lua io.write() not working

I am using a luvit Lua environment to run my lua code through my control panel. I am looking to write to a .txt file, but with the simple code that i am running, its not working.
The reason I wish to write to a .txt file is to log notices from my Discord Bot I am working on in the Discordia library.
I have a folder called MezzaBOT. In this file i have a write.lua file and also a log.txt file. I have this simple code in my write.lua file:
io.output('log.txt')
io.write('hello\n')
io.close()
I then run in my command promt with Luvit environment:
>luvit Desktop\mezzabot\write.lua
I don't get any errors but the log.txt file continues to stay empty. Am I missing a line in my code, or do i need to access log.txt differently?
edit: my new code is the following
file = io.open('log.txt')
file:write('hello', '\n')
file:close()
and it is not making a new line for each time with \n
edit B:
Ok, i found my problem, its creating a log.txt in my C:\Users\PC.
One other problem is when writing, its not making a new line with the \n. Can someone please help me?
Lua, by default, opens files in read mode. You need to explicitly open a file in write mode if you want to write to it (see manual)
file = io.open('log.txt', 'w')
file:write('hello', '\n')
file:close()
Should work :)

How to get Spyder to recognize the setup.cfg file on Windows 10

I'm trying to turn off the ignore max-line-length warnings in Spyder.
This question was answered in another post, but I can't seem to get Spyder to read the config.sys file
[pep8]
max-line-length = 120
I've tried putting it in my current working directory, Python27, Python27/Scripts.
None of those locations turns off the 79 char warning.
I open my .py file by right clicking on it and choose edit in Spyder.
thanks in Advance
Finally understood the comment from Justin Harris in a previous question.
Python: How to tell Spyder's style analysis PEP8 to read from a setup.cfg or increase max. line length?
You should follow these steps:
First, run:
import os; os.path.expanduser('~')
Then, put your .pep8 file in the directory that is displayed by the above command.
The contents of the file to make it ignore lines under 120 characters is:
[pep8]
max-line-length = 120

symfony 1.0 won't return a proper instance on local machine

I recently had to start making small changes to an existing site so I downloaded it and tried to run it but get an error:
Call to undefined method sfContext::getController() in
/home/user/www/site.com/web/index.php on line 16
I tried to figure out which file is being loaded by inserting these lines with this command in index.php right before the dispatch call.
$reflection = new ReflectionClass('sfContext');
$classFile = $reflection->getFileName();
die($classFile);
sfContext::getInstance()->getController()->dispatch();
And it looks like file loaded is:
/home/user/www/site.com/lib/vendor/symfony1.0/test/unit/sfContextMock.class.php
This symfony1.0 site works fine on original server but not on my local machine.
I checked php version and php.ini and they are identical. I cant figure out why wrong class is being loaded or what the problem is.
Here is the index.php file
<?php
define('SF_ROOT_DIR', realpath(dirname(__FILE__).'/..'));
define('SF_APP', 'front');
define('SF_ENVIRONMENT', 'prod');
define('SF_DEBUG', true);
require_once(SF_ROOT_DIR.DIRECTORY_SEPARATOR.'apps'.DIRECTORY_SEPARATOR.SF_APP.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.php');
sfContext::getInstance()->getController()->dispatch();
You should update to the lastest one available (1.0.22).

OpenCV header error (YAML)

Ok so I feel that I have finally successfully used the OpenCV libraries in my app, except for one thing...
My .yml files get generated correctly except the '%YAML:1.0' header at the top turns out like this '01%YAML:1.0'. The '01' infront of the header is causing this error (I think):
OpenCV Error: Parsing error (/var/mobile/Applications/53C6CBA3-15B7-436A-892B-2ECFA75B72CD/Library/DownloadedDescriptors/descriptors.yml(1): Valid XML should start with '<?xml ...?>') in icvXMLParse, file /Users/Dash/Documents/SmartServices/AirLink/ProjectGhost/FairfaxNewsDemo/opencv-2.3.1/OpenCV-2.3.1/modules/core/src/persistence.cpp, line 2163
Anyone know how to solve this issue?
Ok after looking into it a bit further I dont think it's the headers problem. My file always gets generated with '01' at the start.
Hmm...this is embarrassing. But it turns out that I had a 'print' statement lingering in the php file that helps generate my .yaml file, causing 0 and 1 to be added to the beginning of the document.
This meant that my file didn't start with '%YAML:1.0' as expected but '01%YAML:1.0'

Resources