Web Analytics Made Easy -
StatCounter New dedicated server setup, php mkdir and fopen wont work and no error - CodingForum

Announcement

Collapse
No announcement yet.

New dedicated server setup, php mkdir and fopen wont work and no error

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • New dedicated server setup, php mkdir and fopen wont work and no error

    Hi,

    I set up a new dedicated server with webmin/virtualmin on a centos6 64bit with apache 2+ php 5.3.8 and mysql 5.7+ . I am not running suPHP or anything like that, i tried but it was too complicated to set up. So im back to just mod_php and letting apache do the job.

    For some reason i cannot make a dir or a file from a php file in the domain using mkdir

    the file permissions are correct -- i even tried setting to 777 to test
    the file owner is correct -- i tried as owner: owner apache:apache root:root

    i know that safe mode has been removed but i set it to off anyway
    i have disabled suhosin and verified on php info that it is off

    also i did a test with fopen and that did not work either. I also tested folders with is_writable and none are, not even as 777.

    From command line under the owners name and as root i can mkdir no problem but i just cant do it from the domain in a php file. There are no errors in the local log and no errors in the server log. However i may not actually be getting errors to be honest as i noticed when i have a typo in the php the page just crashes rather than give me an error and i have all the error triggers set to on and log, so im not sure if its related or not.

    However what else can i check to find out why im not able to use mkdir to create a folder?

    thanks
    Last edited by durangod; Sep 26, 2016, 01:17 AM.
    I am not crazy, my computer had me checked but its on dialup and im still waiting for results :)
    A good way to remember objects from arrays is you shoot objects with arrows Example: $name->id; then Arrays are $name['id'];
    durangod is short for durango dave

  • #2
    what is the output of command
    sestatus

    My first tought is selinux is blocking the folder creation if it's outside of webroot.
    Don't use old mysql library
    The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets
    When a white horse is not a horse

    Comment


    • #3
      hi thanks,

      SELinux status: disabled

      i thought that as well so i made sure it was disabled yesterday. I may just wipe the server and go with cpanel, i dont like cpanel i think they are rude and not friendly and way overpriced at $45 a month for someone on a budget. But i dont have the experience to do the webmin deal, i need total plug and play. So that might be my best choice so i can get back to coding and not spending my time worring about this kind of thing.

      Thanks for your help
      Last edited by durangod; Sep 26, 2016, 09:44 AM.
      I am not crazy, my computer had me checked but its on dialup and im still waiting for results :)
      A good way to remember objects from arrays is you shoot objects with arrows Example: $name->id; then Arrays are $name['id'];
      durangod is short for durango dave

      Comment


      • #4
        Does the whole folder tree up to the file have execute permissions?
        Don't use old mysql library
        The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets
        When a white horse is not a horse

        Comment


        • #5
          I honestly dont know and i dont even know how to find out. Im not a system admin i just thought it would be nice to finally have my own server so i could have the software i wanted and needed without the hassle and rules of a shared service. What i do is in a very tight bubble, anything inside or below that im ok, anything above that im lost and inexperienced. I guess thats why i need something like cpanel its for stupid people like me
          I am not crazy, my computer had me checked but its on dialup and im still waiting for results :)
          A good way to remember objects from arrays is you shoot objects with arrows Example: $name->id; then Arrays are $name['id'];
          durangod is short for durango dave

          Comment


          • #6
            Hey durangod, I am a Sysadmin. If you want to PM me temporary root credentials I will get it going for you.
            To save time, lets just assume I am almost never wrong.

            The XY Problem
            The XY problem is asking about your attempted solution (X) rather than your actual problem (Y). This leads to enormous amounts of wasted time and energy, both on the part of people asking for help, and on the part of those providing help.

            Make A Donation https://www.paypal.me/KevinRubio

            Comment


            • #7
              Hi benanamen, thanks i appreciate that offer. The problem is that i chose the wrong panel for my experience level. I love what Jamie is trying to do with webmin and i admire his talent and his ambition. But it does not fit my experience level, i really need plug and play. I am having my server company wipe the machine as we speak. Even though i will lose almost two months worth of work, its better to take the hit now than after i have all the domains loaded.

              I have been looking around at panels, i know cpanel i have always used it till now, but its pretty pricey at $45 a month. I have been also looking at centos web panel, they have pretty much auto installs for everything including ffmpeg which is something i need. But then again its a free panel and free panels have their costs's in time working thru the bugs. So i can either give another open source panel a try and hope it will be very user friendly to set up in one day and the next day im loading domains, or pay for cpanel and know i wont have many issues other than having to deal with doing ffmpeg on my own because they dont support it.
              I am not crazy, my computer had me checked but its on dialup and im still waiting for results :)
              A good way to remember objects from arrays is you shoot objects with arrows Example: $name->id; then Arrays are $name['id'];
              durangod is short for durango dave

              Comment


              • #8
                dg you'd have been better getting yourself a raspberry pi and using that on your home connection lol.

                It's:
                linux
                small
                cheap to run..
                "Tango says double quotes with a single ( ' ) quote in the middle"
                '$Name says single quotes with a double ( " ) quote in the middle'
                "Tango says double quotes ( \" ) must escape a double quote"
                '$Name single quotes ( \' ) must escape a single quote'

                Comment


                • #9
                  Originally posted by tangoforce View Post
                  dg you'd have been better getting yourself a raspberry pi and using that on your home connection lol.

                  It's:
                  linux
                  small
                  cheap to run..

                  oh how funny, good one tango, yeah thats what i need a bunch of circut boards laying around collecting the southwestern dust and psoriasis flakes... but they are cute for sure
                  I am not crazy, my computer had me checked but its on dialup and im still waiting for results :)
                  A good way to remember objects from arrays is you shoot objects with arrows Example: $name->id; then Arrays are $name['id'];
                  durangod is short for durango dave

                  Comment


                  • #10
                    There are plastic cases available for them you know
                    "Tango says double quotes with a single ( ' ) quote in the middle"
                    '$Name says single quotes with a double ( " ) quote in the middle'
                    "Tango says double quotes ( \" ) must escape a double quote"
                    '$Name single quotes ( \' ) must escape a single quote'

                    Comment


                    • #11
                      I've always found webmin to be a toy... Have you considered ISPConfig.

                      What you describe reminds me of something that happened to a client of mine a decade ago. They were paying for some big fancy managed hosting that was on RHEL, and one day it just up and decided that PHP wasn't going to be allowed to do anything that involved writing to disk. It first cropped up as a problem with uploads, then it was logging, and eventually the whole mess went tits up.

                      The annoying part was the client came to me because their overpriced support couldn't figure out what was wrong, the guys at Red Hat took a look since it was the enterprise edition, couldn't figure it out... and I tried every check and trick in the book and came up empty.

                      So I told the client "This is rubbish, dimes to dollars it's the overpriced garbage that is Red Hat, let's get you a unmanaged server and go Debian, I'll manage it for you."

                      I went with howtoforge's "Perfect Server with ISPConfig" and reduced their hosting costs LITERALLY 90%. Amazingly even today they keep the instructions on doing such a setup up to date, and really if you're going to do a VPS on the cheap with your own configs, I highly recommend it over anything that's "Red Hat Legacy" like Centos. See, unlike Yum and RPM's, APT and DEB's ACTUALLY attempt to resolve dependencies properly.

                      https://www.howtoforge.com/tutorial/...t-ispconfig-3/

                      I like that one for new setups as it uses MariaDB instead of mySQL. 99.99% of software won't even know the difference, and right now I trust Oracle (who now "owns" mySQL) about as far as I can throw the USS Iowa.

                      Takes a bit of work to make it use PHP 7 though, but if you're not ready for that or it's not a big deal yet, by the time it is a big deal it'll be in the legitimate Debian sources. Anything else you want to install, apt-get isn't rocket science. It's still my go-to since new versions and oddball quirks pop up from time to time as new distro's come along, so it never hurts to have a basic guide to follow (and fall back on when things go tits-up face-down) no matter how "experienced" you might think you are.

                      ISPConfig is good for basic domain, FTP and mail setup. I don't trust "panels" to install actual software anyways as I trust them on that... well, less than I trust Oracle.

                      Just something to consider -- generally you'll find better support, a friendlier community, and overall just less dicking around with Deb/ISPConfig... without the financial woes and "Christmas on a cracker what halfwit made this inaccessible broken garbage UI" that's par for the course with cPanel. My own experience with everything Red Hat legacy -- Fedora, CentOS, Mandriva -- has been a disaster that left me saying "If I wanted to screw around this much with config files and esoteric text commands, I'd drag out the Model 16 and boot up Xenix off 8" floppies!"

                      If nothing else, all of the above is "free" so the only thing wasted if you don't like it is your time. If you're hosting is any good, they'll have a means of giving you a baseline install of Jessie anyways, so you can just take HTF's instructions and skip to step 5. (if you can live with nano... which along with Joe are the shining beacons IMHO of Linux command line text editors; which really is just a statement of how pathetically crappy linux text editors are. vi/vim leaves me thinking "for **** sake, I might as well be using edlin!)

                      Debian may lag behind on bleeding edge features, but their base concept of "proven technologies and security updates only as the baseline" is a pretty solid one -- particularly as other *nix distros have become a breeding ground for "not ready for primetime players" -- jumping the gun on new versions with new features before the bugs are ironed out.

                      ... production servers are not a place to be screwing around deploying glorified beta releases.
                      Walk the dark path, sleep with angels, call the past for help.
                      https://cutcodedown.com
                      https://medium.com/@deathshadow

                      Comment


                      • #12
                        Originally posted by durangod View Post
                        oh how funny, good one tango, yeah thats what i need a bunch of circut boards laying around collecting the southwestern dust and psoriasis flakes... but they are cute for sure
                        Laughably, the Pi is so underpowered and lacking in USEFUL I/O pins, mine's gathering dust... or at least has been gathering dust ever since I got a couple Cubieboards (allwinner A20 makes what's on the Pi look like a sick overpriced joke) and at the low-level the newer 72mhz ARM4 based Teensy's have been kicking names and taking *** on things like motor control, switched inputs -- or even touch based Midi controllers.

                        ...reminds me, need to go buy some Middleton's cigarillo's for the plastic tips, they make a great mouthpiece for homebrew wind controllers.

                        But then I look at the Pi and go "who the hell is this for?!?" -- it lacks the I/O for the Arduino crowd, and isn't powerful enough for the settop crowd. About the only people who like it are the ones who go "rawrz, teach all beginners Python"... yeah, let's not. Most of the people I know who have one have it lost in the back of the sock drawer next to the Geode thin client, Apple Newton, and Atari Portfolio.... and the folks I know who are using them have to put a arduino or stamp on it via USB so they have useful inputs and outputs.
                        Last edited by deathshadow; Sep 27, 2016, 12:18 AM.
                        Walk the dark path, sleep with angels, call the past for help.
                        https://cutcodedown.com
                        https://medium.com/@deathshadow

                        Comment


                        • #13
                          Originally posted by tangoforce View Post
                          There are plastic cases available for them you know
                          tango you know they told me that same thing buddy in grade school they called them "rain pants" and the lunch box cover as well.. lol....


                          deathshadow - yes i been watching this tutorial to try to learn this stuff https://www.youtube.com/channel/UCXN...ACKHYTzY8A8p9Q but the more you know there more there is to know, it never ends. And documentation for apache is like trying to follow lightning strikes, everyone door there are 3 more doors of "do this" . I really thought about debian this time because i do love the apt-get deal and the way it gets the dependencies for you. You should have seen me installing or trying to install mysql and php with CentOS, i think it took me most a day to get thru the dependencies. Of course for me that was the first time since working on the IBM AS400 in my yonger days that i had to do anything from source so it was a long day.

                          I didnt go with debian only because i have always used CentOS and i just didnt want to take a chance on another failed attempt to try to learn something that was too much for me and having to wipe the system again, this time was the 3rd time lol. First time i installed something i should not have from an untrusted repo (i wont do that again) and had to wipe, next time in my rush to secure the machine and SSH i ended up locking my stupid butt out of my own server, they put it in recovery mode for me but i just could not figure that out. Even after reading docs and watching vids i was like huhhhh... so i just had them wipe it the second time.

                          I will say this much though, if your searching for stuff on youtube 85% of what you see is ubuntu and debian, centos stuff is just hard to find. I have to watch the other ones and then just try to figure it out from there.

                          I was actually looking at centos web panel too but again too risky. I went back to cpanel only because for someone like me i have to have it easy to do so i can get back to what i like doing. So i installed it tonight and i have been doing the config and by tomorrow morning ill be ready for domains. Much easier than what i had (webmin) which you have to be more experienced to use, like i said i been at this almost 2 months now. But i admit not all of it was on this server, i was trying to do a game server too and i jumped right into that with both feet got the certs and the licenses and then figured out the stress and time management was affecting my health again so i had to back out of that one. When i get this server smooth running i might try that again but not right now, it mostly sat there for 3weeks and i didnt touch it, bad business decision for me, i jumped too fast..
                          Last edited by durangod; Sep 27, 2016, 04:33 AM.
                          I am not crazy, my computer had me checked but its on dialup and im still waiting for results :)
                          A good way to remember objects from arrays is you shoot objects with arrows Example: $name->id; then Arrays are $name['id'];
                          durangod is short for durango dave

                          Comment


                          • #14
                            Originally posted by durangod View Post
                            oh how funny, good one tango, yeah thats what i need a bunch of circut boards laying around collecting the southwestern dust and psoriasis flakes... but they are cute for sure
                            Oh and i forgot to mention a pi would also be dedicated
                            "Tango says double quotes with a single ( ' ) quote in the middle"
                            '$Name says single quotes with a double ( " ) quote in the middle'
                            "Tango says double quotes ( \" ) must escape a double quote"
                            '$Name single quotes ( \' ) must escape a single quote'

                            Comment


                            • #15
                              Originally posted by deathshadow View Post
                              I like that one for new setups as it uses MariaDB instead of mySQL. 99.99% of software won't even know the difference, and right now I trust Oracle (who now "owns" mySQL) about as far as I can throw the USS Iowa.

                              Takes a bit of work to make it use PHP 7 though
                              I'd call PHP7 a bit more than 99.99% of software myself... and the fact that you admit its hassle to get the two working would ring alarm bells with me as you've just contradicted yourself.

                              Originally posted by deathshadow View Post
                              If nothing else, all of the above is "free" so the only thing wasted if you don't like it is your time.
                              Time being pretty valuable to most people these days.. along with hardware / virtual servers..
                              "Tango says double quotes with a single ( ' ) quote in the middle"
                              '$Name says single quotes with a double ( " ) quote in the middle'
                              "Tango says double quotes ( \" ) must escape a double quote"
                              '$Name single quotes ( \' ) must escape a single quote'

                              Comment

                              Working...
                              X