- Joined
- Oct 10, 2009
- Messages
- 929 (0.18/day)
System Name | Desktop | Laptop |
---|---|
Processor | AMD Ryzen 7 5800X3D | Intel Core i7 7700HQ |
Motherboard | MAG X570S Torpedo Max| Neptune KLS HM175 |
Cooling | Corsair H100x | Twin fan, fin stack & heat pipes |
Memory | 32GB G.Skill F4-3600C16-8GVK @ 3600MHz / 16-16-16-36-1T | 16GB DDR4 @ 2400MHz / 17-17-17-39-2T |
Video Card(s) | EVGA RTX 3080 Ti FTW3 Ultra | GTX 1050 Ti 4GB |
Storage | Kingston KC3000 1TB + Kingston KC3000 2TB + Samsung 860 EVO 1TB | 970 Evo 500GB |
Display(s) | 32" Dell G3223Q (2160p @ 144Hz) | 17" IPS 1920x1080P |
Case | Fractal Meshify 2 Compact | Aspire V Nitro BE |
Audio Device(s) | ifi Audio ZEN DAC V2 + Focal Radiance / HyperX Solocast |
Power Supply | Super Flower Leadex V Platinum Pro 1000W | 150W |
Mouse | Razer Viper Ultimate | Logitech MX Anywhere 2 |
Keyboard | Razer Huntsman V2 Optical (Linear Red) |
Software | Windows 11 Pro x64 |
Hey there.
I have a PHP script executing multiple C programs (which have been placed in /usr/local/bin/) using 'backticks', like so:
$data= `sudo CProg`;
When the C program has executed, it will print to console the values:
5,75
The PHP is then meant to grab the comma-separated values, then 'explode' them and save each into corresponding values:
$dataValues = array_map('trim',explode(",", $data));
$valueOne = $dataValues[0];
$valueTwo= $dataValues[1];
echo "<br>Value 1: $dataValues[0] <br> Value 2: $dataValues[1]<br>";
The problem is the PHP only seems to grab the commas with the echo resulting in only ' , ' being displayed. I know for a fact that this script and program should work as it was working before I had to fully rebuild my Linux (I know, I should have had a backup).
EDIT for reference: I had forgotten to give www-data the ability to execute programs using sudo
I have a PHP script executing multiple C programs (which have been placed in /usr/local/bin/) using 'backticks', like so:
$data= `sudo CProg`;
When the C program has executed, it will print to console the values:
5,75
The PHP is then meant to grab the comma-separated values, then 'explode' them and save each into corresponding values:
$dataValues = array_map('trim',explode(",", $data));
$valueOne = $dataValues[0];
$valueTwo= $dataValues[1];
echo "<br>Value 1: $dataValues[0] <br> Value 2: $dataValues[1]<br>";
The problem is the PHP only seems to grab the commas with the echo resulting in only ' , ' being displayed. I know for a fact that this script and program should work as it was working before I had to fully rebuild my Linux (I know, I should have had a backup).
EDIT for reference: I had forgotten to give www-data the ability to execute programs using sudo
Last edited: