LMSouq

Knowledge Base

Browse Moodle Solutions

2108 solutions found

Page 4 of 106
0 votes
1 ans
3 views
What language are nginx conf files?

I want to write some more complex conditions in my Nginx configuration files but I'm not sure of the syntax and can't find docs describing what you can...

server-admin Solved
JP
asked 1 month ago by JP Silvashy
0 votes
1 ans
3 views
What does force_ssl do in Rails?

In a previous [question][1] I found out that I should be setting nginx ssl termination and not having Rails process encrypted data. Then why does the followi...

server-admin Solved
US
asked 1 month ago by user782220
0 votes
1 ans
3 views
react.js application showing 404 not found in nginx server

I uploaded react.js application to a server. I'm using nginx server. Application is working fine. But when I go to another page & refresh, the site is n...

server-admin Solved
SU
asked 1 month ago by Sunil tc
0 votes
1 ans
3 views
nginx: [emerg] "http" directive is not allowed here in /etc/nginx/sites-enabled/default:1

I'm new to NGINX and I'm trying to setup minimal working thing. So I trying to run aiohttp mini-app with nginx and supervisor (by [this][1] example). Bu...

server-admin Solved
PA
asked 1 month ago by Paul
0 votes
1 ans
4 views
Curly braces in string in PHP

What is the meaning of `{ }` (curly braces) in string literals in PHP?

php-dev Solved
RE
asked 1 month ago by redcoder
0 votes
1 ans
3 views
Format bytes to kilobytes, megabytes, gigabytes

Scenario: the size of various files are stored in a database as bytes. What's the best way to format this size info to kilobytes, megabytes and gigabytes? F...

general-dev Solved
LE
asked 1 month ago by leepowers
0 votes
1 ans
3 views
How do you implement a good profanity filter?

Many of us need to deal with user input, search queries, and situations where the input text can potentially contain profanity or undesirable language. Oftentim...

general-dev Solved
BE
asked 1 month ago by Ben Throop
0 votes
1 ans
4 views
PHP Pass variable to next page

It seems pretty simple but I can't find a good way to do it. Say in the first page I create a variable $myVariable = "Some text"; And...

php-dev Solved
CA
asked 1 month ago by Carlo
0 votes
1 ans
4 views
php is null when empty?

I have a question regarding `NULL` in PHP: $a = ''; if($a == NULL) { echo 'is null'; } Why do I see **is nu...

php-dev Solved
ER
asked 1 month ago by Erin Tucker
0 votes
1 ans
4 views
How to output in CLI during execution of PHP Unit tests?

When running a PHPUnit test, I would like to be able to dump output so I can debug one or two things. I have tried the following (similar to the [PHPUnit Man...

php-dev Solved
JE
asked 1 month ago by Jess Telford
0 votes
1 ans
3 views
PHP function overloading

Coming from C++ background ;) How can I overload PHP functions? One function definition if there are any arguments, and another if there are no argument...

php-dev Solved
VA
asked 1 month ago by Vamsi Krishna B
0 votes
1 ans
3 views
How to call a JavaScript function from PHP?

How to call a JavaScript function from PHP? <?php jsfunction(); // or echo(jsfunction()); // or // Anything e...

php-dev Solved
ZE
asked 1 month ago by Zeeshan Rang
0 votes
1 ans
3 views
How can I easily switch between PHP versions on Mac OSX?

I would like to test my application on PHP 5.3 up to PHP 8.2. Where and how can I install the versions and how can I switch them by running a small script?...

php-dev Solved
XA
asked 1 month ago by Xaver
0 votes
1 ans
3 views
Create or write/append in text file

I have a website that every time a user logs in or logs out I save it to a text file. My code doesn't work in appending data or creating a text file if i...

general-dev Solved
JE
asked 1 month ago by Jerahmeel Acebuche
0 votes
1 ans
3 views
What are the advantages of using getters and setters instead of functions or simply public fields in PHP?

I'm not a PHP developer, so I'm wondering what the advantages and disadvantages are in PHP to using explicit getter/setters, in a pure OOP style, with p...

php-dev Solved
MA
asked 1 month ago by Mark
0 votes
1 ans
3 views
php Replacing multiple spaces with a single space

I'm trying to replace multiple spaces with a single space. When I use `ereg_replace`, I get an error about it being deprecated. ereg_replace("[...

php-dev Solved
DA
asked 1 month ago by Dani
0 votes
1 ans
3 views
PHP - how to best determine if the current invocation is from CLI or web server?

I need to determine whether the current invocation of PHP is from the command line (CLI) or from the web server (in my case, Apache with mod_php). Any recomm...

server-admin Solved
SH
asked 1 month ago by Shameem
0 votes
1 ans
3 views
Explode string on commas and trim potential spaces from each value

For example, I would like to create an array from the elements in this string: $str = 'red, green, blue ,orange'; I know you can e...

php-dev Solved
SE
asked 1 month ago by SeanWM
0 votes
1 ans
3 views
PHP Get Site URL Protocol - http vs https

I've written a little function to establish the current site url protocol but I don't have SSL and don't know how to test if it works under https. *...

php-dev Solved
AN
asked 1 month ago by anon445699
0 votes
1 ans
3 views
What's the difference between :: (double colon) and -> (arrow) in PHP?

There are two distinct ways to access methods in PHP, but what's the difference? $response->setParameter('foo', 'bar'); and...

php-dev Solved
JO
asked 1 month ago by Joe