Tony_D Posted January 5, 2022 Share Posted January 5, 2022 OS = Alamalinux PHP version 7.4.x Docroot = /var/www/html question 1: I have several directories I could have php files in. example /var/www/html/test/user123/ if I place the php file in /var/www/html/test it works just fine but when I put it in /var/www/html/test/user123 I get "file not found" How do I fix this? question 2: related to question 1: same exact file system layout but the files are owned by different users like user123, user124, user125 question 1: only works with apache.apache I need it to be other server users. Thank you Tony Quote Link to comment https://forums.phpfreaks.com/topic/314391-php-settings-questions/ Share on other sites More sharing options...
requinix Posted January 6, 2022 Share Posted January 6, 2022 Which file was not found? What are you doing to get that error? Is it coming from the webserver or from PHP? Why do you have all those users and why are they owning these files? What are the file permissions? Quote Link to comment https://forums.phpfreaks.com/topic/314391-php-settings-questions/#findComment-1593201 Share on other sites More sharing options...
Tony_D Posted January 6, 2022 Author Share Posted January 6, 2022 the file is located in /var/www/html/test user apache group apache This works perfectally fine: http://10.1.10.1/test/1.php When I move the file into /var/www/html/test/user123 This fails when I go to http://10.1.10.1/test/user123/1.php I have users 1-10 for now named user(1,2,3,4,5,6,7,8,9,10) group user(1,2,3,4,5,6,7,8,9,10) I have about 10 users I am trying to code game info / planning moves and I only want the users with the accounts on the system to be able to access the info keeps our competition out: Quote Link to comment https://forums.phpfreaks.com/topic/314391-php-settings-questions/#findComment-1593202 Share on other sites More sharing options...
requinix Posted January 6, 2022 Share Posted January 6, 2022 I'm not sure you understand how users work. Or at least what "users" it is that you need. If you don't want the "competition" to see things then there are a few options, but none of them involve creating users on the server or changing file ownerships or permissions. For instance, if you want something really easy to set up and that it's not something you'll need to change often, then htpasswd-style authentication is quick. Example Quote Link to comment https://forums.phpfreaks.com/topic/314391-php-settings-questions/#findComment-1593203 Share on other sites More sharing options...
Tony_D Posted January 6, 2022 Author Share Posted January 6, 2022 I know the linux side much more that the apache,php side I will be the first to admit that. I have been trying to learn php and have made a little progress under an older version of apache,php on Centos6 and did not have issues with the users and account information granted it was bubblegum and shoestrings holding it all together, through a front end the user logged in as user123 and his/her password and it transfered the files to the directory like test/user 123 that they could edit and or mess up and the log files indicated which person last modified the file so I could find out what went on. I reciently switched to almalinux and much newer apache, and php , better /more complex security. by having everything transfer to the test/user1,2,3,etc) directory I was sometimes able to recover a mess up if someone modified the file prior to the one that messed it up. I was planning on staying on centos but due to the changes I decided to try almalinux, I like it thus far just am very lost with a bunch of OS changes. The switch was use to my cpu melting down, I lost all the configurations by accidently writing over the wrong harddrive, a series of unfortunate events. So just about everything is having to be recreated from scratch. Lucky I have much of the data as this was saved on the data drive backup I thought the backups of the OS was good but it did not follow symlinks and /etc was not there. Thank you Tony_D Quote Link to comment https://forums.phpfreaks.com/topic/314391-php-settings-questions/#findComment-1593205 Share on other sites More sharing options...
gizmola Posted January 6, 2022 Share Posted January 6, 2022 There are also CMS's and Forums that are easy to setup, already come with user authentication systems and ways to author and secure content. Wordpress, Drupal, phpBB, etc. come to mind. Quote Link to comment https://forums.phpfreaks.com/topic/314391-php-settings-questions/#findComment-1593206 Share on other sites More sharing options...
Tony_D Posted January 6, 2022 Author Share Posted January 6, 2022 It took me hours to figure out a few of the changes. The biggest pressing issue is the file deeper in the directory structure not working. The file used to be named something link strategy.html and the html portion of the file worked just fine it ignored the php code inside the .html file. I then copied the same file to the root of the html structure /var/www/html and renamed the file to .php and it worked just fine. I then moved it up one level to /var/www/html/test and kept it renamed to .php and it worked. But when I moved it to /var/www/html/test/user123 then when I tried to access it via browser it returned "File not found." I went through /etc/php.ini and /etc/httpd.conf/http.conf and nothing jumped out at me. Thank you in advance Tony_D Quote Link to comment https://forums.phpfreaks.com/topic/314391-php-settings-questions/#findComment-1593213 Share on other sites More sharing options...
ginerjm Posted January 6, 2022 Share Posted January 6, 2022 It's an .html file is the problem Quote Link to comment https://forums.phpfreaks.com/topic/314391-php-settings-questions/#findComment-1593217 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.