Jump to content

jgp4

Members
  • Posts

    15
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

jgp4's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I should probably add, the server used to be running ubuntu 6.06 and my friend upgraded it to 8.04 so that the version of php would be newer (5.2.4 vs 5.1.6 i think)
  2. The loaded configuration files section of phpinfo simply shows other (extra) configuration files that have been loaded. Not all config options need go within the php.ini. In fact most distrobutions put each extensions configuration within its own ini files so extensions can easily be installed separately. You don't need to restart the server when running under cgi but you might give it a shot. Restart Apache. By the way, I would be running php as an apache module instead of as cgi unless you have specific reasons to do so. This is what I see in phpinfo - usually the first two are the same and the additional files are shown below. We've restarted apache a number of times. Configuration File (php.ini) Path /etc/php5/cgi Loaded Configuration File /etc/suphp/suphp.conf Scan this dir for additional .ini files /etc/php5/cgi/conf.d additional .ini files parsed /etc/php5/cgi/conf.d/curl.ini, /etc/php5/cgi/conf.d/gd.ini, /etc/php5/cgi/conf.d/mcrypt.ini, /etc/php5/cgi/conf.d/mysql.ini, /etc/php5/cgi/conf.d/mysqli.ini, /etc/php5/cgi/conf.d/pdo.ini, /etc/php5/cgi/conf.d/pdo_mysql.ini, /etc/php5/cgi/conf.d/pspell.ini, /etc/php5/cgi/conf.d/xmlrpc.ini
  3. Hi, A friend of mine has just bought a dedicated server and has asked me to do a few things to it. One thing he wants of the max execution time to be 1800, so I checked phpinfo which said that the php.ini file was in /etc/php5/cgi however none of the changes I make in this file take effect. I then noticed that the Loaded Configuration File value in phpinfo is set to /etc/suphp/suphp.conf however this file doesn't appear to reference php.ini and doesn't have any of the normal php config stuff in it. I checked another server with suhosin installed and the 2 values (Configuration File (php.ini) Path, Loaded Configuration File ) were the same (/etc/php5/apache2 and /etc/php5/apache2/php.ini) Is the server configured wrong, and if so how can I change where PHP looks for its config data. Thanks, Jon
  4. Thanks guys, all great answers, I'll look into the multiple bitmasks and ACL like mchl suggests. Just to clarify the situation, I'm working on a CMS/Ecommerce platform which has many modules each with lots of functions, so there will be more than 32 different things a user could potentially do - at the very least add, approve and delete in each module - i may see how simple it would be to have a bitmask for each module. Will update once I've found what seems to be the best solution. Thanks again.
  5. Hi, I've just started looking at using bitmasks for permissions in my work as they seem like a nice way to handle things, however I've just had a thought. As the different permission values will be stored as a power of 2, will i only be able to have 32 of them because my server is 32bit? I.E. if I try and set a permission with a bitmask of 2^33 will the server say no? I must admit I haven't tried this out much, as I'm so new to it, but if anyone can offer some insight I'd be very grateful. Thanks.
  6. Thanks bluejay, I'm not sure how big any of the sites the CMS will be running on may get - we currently have some which are only about 30 or 40 pages, but we also have others which are hundreds, so I think I may have to do some benchmarking on it.
  7. Hi, I'm redeveloping a CMS at work which in the past ran solely from a mysql db, however to improve performance the new system will generate static content when a page is created/editing in the admin. The main thing I've yet to decide how to do is the menu generation code for the front end. In the past the system did a standard recursive function getting all pages which are children of the current page from the database. What I was thinking about doing was, at the same time changes are made in the admin, generate an XML file which represents the sitemap of the site and rather than doing a lot of db access when drawing the menu, parse the XML file with simpleXML. Does anyone have any idea how the two methods may compare performance wise? Thanks in advance.
  8. Hi, I'm working on a new ecommerce application at work and am trying to implement as many features as possible, one of which being the ability to switch from a mysql db to a postgres one pretty much instantly. Is this possible with PDO? I don't have much experience with postgres, all I really know is that it does auto increment differently and supports things like inheritance. Do you think it would be possible to create an application which only used cross DBMS queries? Thanks in advance.
  9. Hi, I'm having trouble making my queries safe from SQL Injection. I have a DB class which has a function runQuery whihc takes the query as a parameter. It then does the following code (taken directly from php.net): if (get_magic_quotes_gpc()) {           $query = stripslashes($query); } if (!is_numeric($query)) {           $query = "'" . mysql_real_escape_string($query) . "'"; } before the mysql_real_escape_string the query comes out as: SELECT * FROM config WHERE cfg_name='default' LIMIT 1 I'm just using a random table to test it out before using it on user data - this query string does work. After mysql_real_escape_string the query is like this: SELECT * FROM config WHERE cfg_name=\'default\' LIMIT 1 As one expects the apostraphes have been escaped however when I do mysql_query($query) i get the following message: Query error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\'default\' LIMIT 1' at line 1 (MySQL error 1064) I also get this error when running the query from the commandline. I have also tried just addslashes but as it does exactly the same thing the same error appears. Is there something blindingly obvious I have neglected to do or it something odd going on? Thanks.
  10. just tried something new if I put a copy of config.php in the classes folder, and put include('config.php'); it works. So i assume that although the DBAdmin code is included into index.php and instantiated from it, when accessing the filesystem, it does so relative to DBAdmins.php's location rather than index.php's. Does that make sense?
  11. Hi. I'm having trouble dealing with scope in one of my apps. I've written a class to handle dealing with the database, but the username, password and host data are in another file, so what I did, in index.php is include both files: include('includes/config.php'); include('includes/classes/DBAdmin.php'); and in the constructor for DBAdmin I try to access variables in config.php but it doesn't work. I put global $username; etc. in config.php, but the DBAdmin object still can't see them. Can an object only 'see' variables if they are inside its class? This leads to my second problem: I changed the constructor to include config.php directly, to get around the scope problem but I get an inclusion error. config.php is one level up from the class file and so I use include(../config.php); Is the path to the included file wrong, due to the fact that DBAdmin is included in index.php? Should I try include(includes/config.php instead); Thanks in advance
  12. Hi. I'm having trouble dealing with scope in one of my apps. I've written a class to handle dealing with the database, but the username, password and host data are in another file, so what I did, in index.php is include both files: include('includes/config.php'); include('includes/classes/DBAdmin.php'); and in the constructor for DBAdmin I try to access variables in config.php but it doesn't work. I put global $username; etc. in config.php, but the DBAdmin object still can't see them. Can an object only 'see' variables if they are inside its class? This leads to my second problem: I changed the constructor to include config.php directly, to get around the scope problem but I get an inclusion error. config.php is one level up from the class file and so I use include(../config.php); Is the path to the included file wrong, due to the fact that DBAdmin is included in index.php? Should I try include(includes/config.php instead); Thanks in advance
  13. I've been going thru forum after forum looking for an answer to this, but can find nothing, so I hope someone here can help. Say I have a string, and inside it is the text ::include(/includes/snippets/snippet.php):: what i'd like to do is find that text, extract the text from between the ::'s and eval() it, then do a preg_replace to insert the code generated back in - can someone help, I have no idea how to do regex's. Thanks.
×
×
  • 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.