Jump to content

HiImNew

New Members
  • Posts

    7
  • Joined

  • Last visited

HiImNew's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Yes I did. $sql = mysqli_query($connection, "SELECT `user` FROM `chat_users` WHERE `access` = '0' OR `access` = '1' OR `access` = '2' "); while($row = mysqli_fetch_array($sql)) { error_log(print_r($row, true)); } [23-Aug-2016 21:29:44 America/New_York] Array ( [0] => Admin [user] => Admin )
  2. I've read the page but I'm not sure how that would work? I want to get a list of all 3 values, not just one.
  3. Is it possible to use multiple WHERE clauses to find values? Such as: $sql = mysqli_query($connection, "SELECT `user` FROM `chat_users` WHERE ( (`access` = '0') AS `test`, (`access` = '1') AS `test2`, (`access` = '2') AS `test3` )"); I'm just trying to generate a list of users based on their access level in one query if possible. Not too familiar with joins if that is what this requires.
  4. To put it simply, I offer a download to users. That download has the ability to update automatically through my API in which it downloads the patch files directly off the site. Originally I had it so that it would give the link to the file directly through communications. But I will change that so it serves it instead from the API request landing page or through a temporary mirror. My bad for the lack of explanation. The one file does both. Creates a progress file and scans all of the system files. Unrelated to the aforementioned API. I take it that means I have to stick with 770?
  5. I was just wondering if it were possible. It's not a file going into the document root, but it is being downloaded through a "self-served" API which the user could intercept the filename + location from. Nothing more than an inconvenience really. Will just work around and serve a temporary mirrored location. I'm not getting away with anything but 0770 permissions it seems. 730 is creating a RecursiveDirectoryIterator fault: [13-Aug-2016 20:29:05 America/New_York] PHP Fatal error: Uncaught exception 'UnexpectedValueException' with message 'RecursiveDirectoryIterator::__construct(/var/www/html/***/DirectoryName): failed to open dir: Permission denied' in /var/www/html/***/DirectoryName/functions.inc.php:35 Stack trace: #0 [internal function]: RecursiveDirectoryIterator->__construct('/var/www/html/a...', 0) #1 /var/www/html/***/DirectoryName/functions.inc.php(35): RecursiveDirectoryIterator->getChildren() #2 /var/www/html/***/DirectoryName/process.php(108): file_search('test', false, 'progress-1.txt') #3 {main} thrown in /var/www/html/***/DirectoryName/functions.inc.php on line 35 Only way of fixing it seems to be giving Group Read rights to the directory
  6. Thank you for the response! I have done as you said, setting it to root www-data and giving the permissions of 0740, but it still will not serve a HTTP 403 error when viewing through the browser (I probably should have explained a bit further). It will still be accessible for viewing through the browser. Is there a way to serve a 403 error through the browser but still allow PHP to access it? Such as if I wanted a zip file not to be hotlinked (Without the use of htaccess) but still be able to download through PHP like my old server had it. Files are unable to be created on the server unless I give the directory 775 permissions, which I reaaaallly don't want to (And probably shouldn't?) do. The directory is root www-data.
  7. So I've recently switched over from shared hosting to vps hosting and starting a server from scrath. Transitioning has come with some troublesome problems that I can't find a solution for anywhere. I've been searching for the past couple days on and off but can't find any other solutions that match my exact criteria. So. What I've got: 1. File permissions are not working how they used to. Before, all I had to do was set a file to 0640 and it would serve an HTTP 403 server code when viewing it in the browser, but could still be accessed through PHP. Now, If viewed in the browser, it issues a PHP error: [13-Aug-2016 18:18:41 America/New_York] PHP Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0 [13-Aug-2016 18:18:41 America/New_York] PHP Fatal error: Unknown: Failed opening required '/var/www/html/inc/init.inc.php' (include_path='.:/usr/share/php:/usr/share/pear') in Unknown on line 0 As well as not being accessible through PHP (i.e. require()); same error. Now, that is with the owner/group of root root. If I create the file through FTP which gives an owner/group of root www-data it displays in the browser and is accessible through PHP with 0640??? Perhaps an ownership rights issue? 2. Fopen is failing when creating a file giving an error of: [13-Aug-2016 18:31:12 America/New_York] PHP Warning: fopen(progress.txt): failed to open stream: Permission denied in /var/www/html/***/process.php on line 31 When creating a file through PHP, the owner/group is www-data www-data. The directory has 0755 perms and is still giving a permission denied prompt? Another ownership rights issue I'm suspecting. Not looking for an all-out solution. Just any advice would be appreciated! I'm not sure about what information to provide.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.