Skip to main content

All Questions

Tagged with
0 votes
0 answers
55 views

Why might PHP be incorrectly detecting it is running a web (and not a console) context? [duplicate]

I have a PHP script on a shared web host that reads a lot of log files and summarises data in JSON format. This script is run periodically via Cron. I do not control the server, but I have FTP access. ...
halfer's user avatar
  • 20.3k
0 votes
1 answer
50 views

Yii2 unable to run console commands

When I'm trying to run yii2 console command - I just get list of commands in response: The following commands are available: - asset Allows you to combine and compress your ...
Regular User's user avatar
-1 votes
1 answer
36 views

The script in the yii controller works, but it doesn't work through the yii console application

I have a yii controller that creating folder and downloading images in it with curl. If I run script from browser it works like I needed, all good, but if I try to run this script from the terminal ...
riskindness's user avatar
1 vote
1 answer
778 views

Different PHP versions in the console and when running php -v via PHP script

Hello dear Stackoverflow community, I have encountered an unusual issue with PHP versions on my server (ubuntu), and I'm hoping you can assist me. When I log in to my server via the console (SSH) and ...
aim2k1's user avatar
  • 35
1 vote
1 answer
166 views

How to process a large amount of files without running in memory limit error?

I am trying to run this command and to zip ca. 11.000 files - I'm getting memory_limit error. The code below needs ca. 12GB from my memory_limit and it works only if i set the memory_limit to -1, but ...
ddd's user avatar
  • 73
0 votes
1 answer
263 views

VueJS access data values from console

I am beginner with Vue and i didn't find answer for my question... I use Vue over this CDN: https://unpkg.com/vue@3/dist/vue.global.js And this is my VueJS testing code: const { createApp } = Vue ...
user2812532's user avatar
0 votes
2 answers
115 views

Laravel 10 unwanted Printing of File Content in Console\Commands

I load a text file with file_get_contents(dirname(__FILE__).'/templates/Modell.php'); the first line in this file is startphp instead of <?php. It will be replaced later. I want this file in a ...
Nikolaus Pluta's user avatar
0 votes
3 answers
1k views

'symfony' is not recognized as an internal or external command, operable program or batch file

I install new symfony project by using this command composer create-project symfony/website-skeleton sym-toturial Now when I run this command to start the server and run the project it is not ...
Timothy's user avatar
  • 77
1 vote
0 answers
267 views

PHP/SSH: How to output (echo) ssh result if they content multiple page?

I am try connect by SSH to device (in my case Huawei switch), execute command and print result on web page. If my $ssh_input equal like 'display arp | i 10.100.1.1' i have next result in terminal and ...
Narmo's user avatar
  • 11
0 votes
1 answer
48 views

laravel command code exctraction into function

I have console command php artisan pictures:create-thumbs, which creates thumbs from big images: Put all images into array. Get rid of some temporary files, which create errors during script ...
schel4ok's user avatar
  • 644
0 votes
2 answers
2k views

Display console.log equivalent of PHP onto leetcode console terminal

How can I console.log/error_log when coding on the leetcode terminal in PHP such that I can see my messages on the console terminal?
Yeo Bryan's user avatar
  • 397
0 votes
1 answer
2k views

Import laravel excel depending on the sheet name

I have an Excel file with several sheets, each sheet has a specific name and that name is in the "name" column of a product table. I want to make that when I import the Excel file, the name ...
elquenosabe's user avatar
0 votes
1 answer
319 views

Accessing PHP File inside PHAR Archive through Command Line

I'm not sure if this is possible, but i am trying to access a PHP File inside the PHAR Archive over the command Line on a RHEL 7.0 machine. I was able to create the PHAR archive and can use it also ...
Sascha's user avatar
  • 1
1 vote
1 answer
66 views

Strange char with readline on terminal app

I am writing php-console app with readline use for user input commands. This is how I am using it: $input = readline("\033$label\033\n"); And it looks like this in cmd terminal: But with ...
CubeStorm's user avatar
  • 138
0 votes
0 answers
251 views

mb_convert_encoding() different results depending on PHP version

In PHP 5.6, I have always used the next function to echo UTF-8 strings in Windows console with no issue: function console($utf8_string) { $dos = mb_convert_encoding($utf8_string, "CP850",...
Carles Serra's user avatar

15 30 50 per page
1
2 3 4 5
26